FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

IO: Add a 100ms timeout to I2C to allow communication with Arduino · aaronlwilson/processing@8542edd · GitHub

Repository navigation

Commit 8542edd

Browse files
committed
IO: Add a 100ms timeout to I2C to allow communication with Arduino
Note this currently does not include the compiled binary for linux-arm64
1 parent f1aae67 commit 8542edd

4 files changed

Lines changed: 3 additions & 0 deletions

File tree

4.01 KB
Binary file not shown.
36 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.

‎java/libraries/io/src/native/impl.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ JNIEXPORT jint JNICALL Java_processing_io_NativeInterface_transferI2c
323323
packets.nmsgs++;
324324
}
325325

326+
// set the timeout to 100ms - this helps slow devices such as the
327+
// Arduino Uno to keep up
328+
ioctl(handle, I2C_TIMEOUT, 10);
326329
int ret = ioctl(handle, I2C_RDWR, &packets);
327330
if (ret < 0) {
328331
ret = -errno;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL