diff --git a/src/I2CFirmata.h b/src/I2CFirmata.h index e837a7bb..f08edb7b 100644 --- a/src/I2CFirmata.h +++ b/src/I2CFirmata.h @@ -111,6 +111,7 @@ void I2CFirmata::readAndReportData(byte address, int theRegister, byte numBytes, Firmata.sendString("I2C: Too many bytes received"); } else if (numBytes > Wire.available()) { Firmata.sendString("I2C: Too few bytes received"); + numBytes = Wire.available(); } i2cRxData[0] = address;