|
Nol.A SDK Library 26.11.2
For IoT System Software Development
|
Timer-driven asynchronous HTU20D temperature and humidity driver. Initialize the I2C bus, call begin(), and register callbacks before requesting readings. Keep the driver and bus alive until the measurement completes. More...
#include <HTU20D.hpp>
Public Member Functions | |
| void | begin (TwoWire &) |
| Bind an initialized I2C bus and initialize the measurement timer. | |
| void | onTemperatureReadDone (void(*func)(uint16_t val)) |
| Register the temperature callback; nullptr disables notification. | |
| void | readTemperature () |
| Start a temperature measurement, replacing any pending measurement. Reads after 50 ms and retries every 10 ms while no bytes are available; no timeout. | |
| void | onHumidityReadDone (void(*func)(uint16_t val)) |
| Register the humidity callback; nullptr disables notification. | |
| void | readHumidity () |
| Start a humidity measurement, replacing any pending measurement. Reads after 50 ms and retries every 10 ms while no bytes are available; CRC is not checked. | |
Timer-driven asynchronous HTU20D temperature and humidity driver. Initialize the I2C bus, call begin(), and register callbacks before requesting readings. Keep the driver and bus alive until the measurement completes.
| void HTU20D::onHumidityReadDone | ( | void(* | func )(uint16_t val) | ) |
Register the humidity callback; nullptr disables notification.
| func | Receives the current driver formula 12500 * raw / 65536 - 6. This is not directly percent RH; the offset is not scaled like the raw term. |
| void HTU20D::onTemperatureReadDone | ( | void(* | func )(uint16_t val) | ) |
Register the temperature callback; nullptr disables notification.
| func | Receives the integer result 17572 * raw / 65536 - 4685, nominally hundredths of a degree Celsius. Negative results wrap in the uint16_t argument. |