Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
HTU20D Class Reference

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.

Detailed Description

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.

Author
Jongsoo Jeong (CoXlab)
Date
2016. 6. 13.

Member Function Documentation

◆ onHumidityReadDone()

void HTU20D::onHumidityReadDone ( void(* func )(uint16_t val))

Register the humidity callback; nullptr disables notification.

Parameters
funcReceives the current driver formula 12500 * raw / 65536 - 6. This is not directly percent RH; the offset is not scaled like the raw term.

◆ onTemperatureReadDone()

void HTU20D::onTemperatureReadDone ( void(* func )(uint16_t val))

Register the temperature callback; nullptr disables notification.

Parameters
funcReceives the integer result 17572 * raw / 65536 - 4685, nominally hundredths of a degree Celsius. Negative results wrap in the uint16_t argument.

The documentation for this class was generated from the following file: