-
• #2
Hi,
check the BoschSenortec github account, there is a completely BMI160 driver written in c (rewriting c code to javascript is not that hard).
Hint: Start with Init the sensor and then try to Read some values.
-
• #3
You are on the right way, the
209
decimal in the response is0b11010001
as shown on the datasheet screenshot! -
• #4
Thank you for all responses,
They read the sensor ready data like this
rslt = bme280_set_regs(®_addr, &soft_rst_cmd, 1, dev); (rslt == BME280_OK) //BME280_OK = INT8_C(0)
I did:
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 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?
Hi, I bought bosh bmi160 Gyro & accelerometer but I couldnt find any module in espruino module page. I did some research found docs for sensor. I tried i2c connection I am able to write data and see data changing with different commands given in docs. The problem is when I read console by interval function I get uint8Array I dont know what to do with it I tried to convert to hex I got different data with different commands. According to Bosh Docs (I put link to bottom) if I send
0x00
I will read chipId I sended code with following codeResult:
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmi160-ds000.pdf#page=19
Sorry about my english I tried my best