5 #ifndef _ADAFRUIT_HTU31D_H 6 #define _ADAFRUIT_HTU31D_H 8 #include <Adafruit_BusIO_Register.h> 9 #include <Adafruit_I2CDevice.h> 10 #include <Adafruit_Sensor.h> 13 #define HTU31D_DEFAULT_I2CADDR (0x40) 16 #define HTU31D_READTEMPHUM (0x00) 19 #define HTU31D_CONVERSION (0x40) 22 #define HTU31D_READSERIAL (0x0A) 25 #define HTU31D_HEATERON (0x04) 28 #define HTU31D_HEATEROFF (0x02) 31 #define HTU31D_RESET (0x1E) 49 int _sensorID = 0x31D1;
68 int _sensorID = 0x31D0;
81 TwoWire *theWire = &Wire);
83 uint32_t readSerial(
void);
85 bool enableHeater(
bool en);
87 bool getEvent(sensors_event_t *humidity, sensors_event_t *temp);
88 Adafruit_Sensor *getTemperatureSensor(
void);
89 Adafruit_Sensor *getHumiditySensor(
void);
98 Adafruit_I2CDevice *i2c_dev = NULL;
107 void fillTempEvent(sensors_event_t *temp, uint32_t timestamp);
109 void fillHumidityEvent(sensors_event_t *humidity, uint32_t timestamp);
#define HTU31D_DEFAULT_I2CADDR
Definition: Adafruit_HTU31D.h:13
uint16_t _sensorid_humidity
ID number for humidity.
Definition: Adafruit_HTU31D.h:95
float _temperature
Last reading's temperature (C)
Definition: Adafruit_HTU31D.h:92
Definition: Adafruit_HTU31D.h:75
void getSensor(sensor_t *)
Gets the sensor_t object describing the HTU31D's humidity sensor.
Definition: Adafruit_HTU31D.cpp:248
uint16_t _sensorid_temp
ID number for temperature.
Definition: Adafruit_HTU31D.h:96
Adafruit_HTU31D_Temp(Adafruit_HTU31D *parent)
Create an Adafruit_Sensor compatible object for the temp sensor.
Definition: Adafruit_HTU31D.h:62
Adafruit Unified Sensor interface for the temperature sensor component of HTU31D. ...
Definition: Adafruit_HTU31D.h:58
Adafruit Unified Sensor interface for the humidity sensor component of HTU31D.
Definition: Adafruit_HTU31D.h:40
Adafruit_HTU31D_Humidity(Adafruit_HTU31D *parent)
Create an Adafruit_Sensor compatible object for the humidity sensor.
Definition: Adafruit_HTU31D.h:44
bool getEvent(sensors_event_t *)
Gets the humidity as a standard sensor event.
Definition: Adafruit_HTU31D.cpp:268