BH1730 sensor

Github Repo C Header C source JS source
mongoose-os-libs/bh1730 bh1730.h   api_bh1730.js

This library provides support for the digital 16-bit ambient light sensor BH1730.

See API documentation: for C and mJS.


Mongoose OS C driver (mJS bindable) for Rohm BH1730 light sensor


bh1730_init

bh1730_t *bh1730_init(int addr);

Create and return a BH1730 instance; addr is an I2C address of the BH1730 sensor.

bh1730_read_lux

float bh1730_read_lux(bh1730_t *d);

Return the ambient light level in lux, or -1 in case of a failure.

JS API


BH1730.create

BH1730.create(addr)

Create a BH1730 instance: an object with the methods described below. addr is an i2c address of the BH1730 sensor.

myBH.read_lux

myBH.read_lux()

Return the ambient light level in lux, or -1 in case of a failure.

edit this doc