| Github Repo | C Header | C source | JS source |
|---|---|---|---|
| mongoose-os-libs/bm222 | mgos_bm222.h | api_bm222.js |
This is a library for the Bosch BM222 accelerometer. See https://www.bosch-sensortec.com/bst/products/all_products/bma222e for more information about the hardware.
BM222 accelerometer API.
See https://www.bosch-sensortec.com/bst/products/all_products/bma222e for more information.
BM222.init(bus, addr)
Initialize BM222 sensor on a given I2C bus and addr.
Returns true on success, false otherwise.
BM222.read()
Read sensor values given I2C bus and addr.
In case of success, returns array of 3 integers: x, y, z.
Otherwise returns null.