readI2Cblock method
Reads a byte array from the I2C bus.
Implementation
List<int> readI2Cblock(int len) {
autoWait();
var error = I2Cexception.empty();
for (var i = 0; i < retry; ++i) {
try {
var data = i2c.readBytesReg(hatArduinoI2Caddress, hatRegister, len);
_updateLastAction();
return data;
} on I2Cexception catch (e) {
error = e;
sleep(Duration(milliseconds: delay));
}
}
throw error;
}