| Github Repo | C Header | C source | JS source |
|---|---|---|---|
| mongoose-os-libs/tmp006 | mgos_tmp006.h | api_tmp006.js |
This is a library for the Texas Instruments TMP006 temperature sensor. See http://www.ti.com/product/TMP006 for more information about the hardware.
bool mgos_tmp006_setup(struct mgos_i2c *bus, uint8_t addr,
enum tmp006_conversion_rate rate, bool drdy_en);
Initialize TMP006 driver on the given I2C
busandaddr, with the given conversion rate (seeenum tmp006_conversion_rate). To enableDRDYpin, setdrdy_entotrue.Returns
truein case of success,falseotherwise.
double mgos_tmp006_get_voltage(struct mgos_i2c *i2c, uint8_t addr);
Get voltage from the TMP006 sensor at the given i2c bus and addr. In case of failure, returns
TMP006_INVALID_READING.
double mgos_tmp006_get_die_temp(struct mgos_i2c *i2c, uint8_t addr);
Get temperature in C degrees from the TMP006 sensor at the given i2c bus and addr. In case of failure, returns
TMP006_INVALID_READING.