Class that stores state and functions for interacting with the AHT10/AHT20 I2C Temperature/Humidity sensor.
More...
#include <Adafruit_AHTX0.h>
|
| Adafruit_AHTX0 () |
| Instantiates a new AHTX0 class.
|
|
bool | begin (TwoWire *wire=&Wire, int32_t sensor_id=0, uint8_t i2c_address=AHTX0_I2CADDR_DEFAULT) |
| Sets up the hardware and initializes I2C. More...
|
|
bool | getEvent (sensors_event_t *humidity, sensors_event_t *temp) |
| Gets the humidity sensor and temperature values as sensor events. More...
|
|
uint8_t | getStatus (void) |
| Gets the status (first byte) from AHT10/AHT20. More...
|
|
Adafruit_Sensor * | getTemperatureSensor (void) |
| Gets the Adafruit_Sensor object for the AHTx0's humidity sensor. More...
|
|
Adafruit_Sensor * | getHumiditySensor (void) |
| Gets the Adafruit_Sensor object for the AHTx0's humidity sensor. More...
|
|
Class that stores state and functions for interacting with the AHT10/AHT20 I2C Temperature/Humidity sensor.
◆ begin()
bool Adafruit_AHTX0::begin |
( |
TwoWire * |
wire = &Wire , |
|
|
int32_t |
sensor_id = 0 , |
|
|
uint8_t |
i2c_address = AHTX0_I2CADDR_DEFAULT |
|
) |
| |
Sets up the hardware and initializes I2C.
- Parameters
-
wire | The Wire object to be used for I2C connections. |
sensor_id | The unique ID to differentiate the sensors from others |
i2c_address | The I2C address used to communicate with the sensor |
- Returns
- True if initialization was successful, otherwise false.
◆ getEvent()
bool Adafruit_AHTX0::getEvent |
( |
sensors_event_t * |
humidity, |
|
|
sensors_event_t * |
temp |
|
) |
| |
Gets the humidity sensor and temperature values as sensor events.
- Parameters
-
humidity | Sensor event object that will be populated with humidity data |
temp | Sensor event object that will be populated with temp data |
- Returns
- true if the event data was read successfully
◆ getStatus()
uint8_t Adafruit_AHTX0::getStatus |
( |
void |
| ) |
|
Gets the status (first byte) from AHT10/AHT20.
- Returns
- 8 bits of status data, or 0xFF if failed
◆ getTemperatureSensor()
Adafruit_Sensor * Adafruit_AHTX0::getTemperatureSensor |
( |
void |
| ) |
|
Gets the Adafruit_Sensor object for the AHTx0's humidity sensor.
- Returns
- Adafruit_Sensor*
◆ getHumiditySensor()
Adafruit_Sensor * Adafruit_AHTX0::getHumiditySensor |
( |
void |
| ) |
|
Gets the Adafruit_Sensor object for the AHTx0's humidity sensor.
- Returns
- Adafruit_Sensor*
◆ Adafruit_AHTX0_Temp
Gives access to private members to Temp data object
◆ Adafruit_AHTX0_Humidity
Gives access to private members to Humidity data object
◆ humidity_sensor
Initial value:
Humidity sensor data object.
The documentation for this class was generated from the following files: