var ERR_REG = 0x02;//According to docs at page 49
var adr = 0x69;
var len = 5;//
I2C1.writeTo(adr,ERR_REG);
var response = toHexString(I2C1.readFrom(adr,16)).sliceĀ(0,len);
//Response = 00000
If the data is correct 5 zero bit is tells sensor is working correct
But when I tried to get chip id with same code with len = 7 I get 1414240 (Without converting to hex [ 20, 20, 36, 4, 10, 24, 72 ]). In the driver I must get UINT8_C(0x60) or 0x60 the thing is is 0x60 equal to 1414240 ? or am I converting wrong?
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.
Thank you for all responses,
They read the sensor ready data like this
I did:
If the data is correct 5 zero bit is tells sensor is working correct
But when I tried to get chip id with same code with
len = 7
I get1414240
(Without converting to hex[ 20, 20, 36, 4, 10, 24, 72 ]
). In the driver I must get UINT8_C(0x60) or0x60
the thing is is0x60
equal to 1414240 ? or am I converting wrong?