Hi - yes, the software I2C implementation does do some error checking but it doesn't throw an error if there isn't an explicit acknowledge to a read request, it just returns 255.
You could try hardware I2C - the only difference in your code would be changing var i = new I2C(); to var i = I2C1;. It will probably then throw an error if a device isn't connected (but hardware I2C might require external pullup resistors).
However, the problems you're having with unexpected values for reads are unlikely to be related to that - maybe you could share the code you were using to read a value that wasn't working, and what device/value you were trying to read and I might be able to figure out what's up?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - yes, the software I2C implementation does do some error checking but it doesn't throw an error if there isn't an explicit acknowledge to a read request, it just returns 255.
You could try hardware I2C - the only difference in your code would be changing
var i = new I2C();
tovar i = I2C1;
. It will probably then throw an error if a device isn't connected (but hardware I2C might require external pullup resistors).However, the problems you're having with unexpected values for reads are unlikely to be related to that - maybe you could share the code you were using to read a value that wasn't working, and what device/value you were trying to read and I might be able to figure out what's up?