Skip to content

Commit f13d317

Browse files
fixed delayMicroseconds(0) bug in readAndReportData that was causing delays when reporting i2c data
1 parent 8f7a8ec commit f13d317

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/StandardFirmata/StandardFirmata.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ void readAndReportData(byte address, int theRegister, byte numBytes) {
9999
Wire.send((byte)theRegister);
100100
#endif
101101
Wire.endTransmission();
102-
delayMicroseconds(i2cReadDelayTime); // delay is necessary for some devices such as WiiNunchuck
102+
// do not set a value of 0
103+
if (i2cReadDelayTime > 0) {
104+
// delay is necessary for some devices such as WiiNunchuck
105+
delayMicroseconds(i2cReadDelayTime);
106+
}
103107
} else {
104108
theRegister = 0; // fill the register with a dummy value
105109
}

0 commit comments

Comments
 (0)