Hello, I'm trying to figure out an error, when I realized that the problem is that I'm using wrong the I2C function. I need to read 8 bits from an address (0x75) in a i2c device (0x68). Following code is an example from libraries and docs:
I2C1.setup( {scl: NodeMCU.D4, sda: NodeMCU.D5} );
I2C1.writeTo(0x68,0x75);
var data = I2C1.readFrom(0x75,8);
console.log(data);
Got the next error:
Uncaught InternalError: I2CRead: No ACK 0
at line 5 col 33
var data = I2C1.readFrom(0x75,8);
^
in function called from system
The readFrom function doesn't take as parameter the internal address of the device, that's why the error, is pointing to a device no to the internal address.
My device is an MPU9250, it works on Arduino and Micropython.
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.
Hello, I'm trying to figure out an error, when I realized that the problem is that I'm using wrong the
I2C
function. I need to read 8 bits from an address (0x75
) in a i2c device (0x68
). Following code is an example from libraries and docs:Got the next error:
The
readFrom
function doesn't take as parameter the internal address of the device, that's why the error, is pointing to a device no to the internal address.My device is an
MPU9250
, it works on Arduino and Micropython.