TI TMP006 temp sensor

Github Repo C Header C source JS source
mongoose-os-libs/tmp006 mgos_tmp006.h   api_tmp006.js

Overview

This is a library for the Texas Instruments TMP006 temperature sensor. See http://www.ti.com/product/TMP006 for more information about the hardware.


mgos_tmp006_setup

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 bus and addr, with the given conversion rate (see enum tmp006_conversion_rate). To enable DRDY pin, set drdy_en to true.

Returns true in case of success, false otherwise.

mgos_tmp006_get_voltage

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.

mgos_tmp006_get_die_temp

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.

JS API


edit this doc