Class that stores state and functions for interacting with AM2320 Temperature & Humidity Unified Sensor.
More...
#include <Adafruit_AM2320.h>
Class that stores state and functions for interacting with AM2320 Temperature & Humidity Unified Sensor.
◆ Adafruit_AM2320()
Adafruit_AM2320::Adafruit_AM2320 |
( |
TwoWire * |
theI2C = &Wire , |
|
|
int32_t |
tempSensorId = -1 , |
|
|
int32_t |
humiditySensorId = -1 |
|
) |
| |
Instantiates a new AM2320 class.
- Parameters
-
theI2C | Optional pointer to a TwoWire object that should be used for I2C communication. Defaults to &Wire. |
tempSensorId | the id that should be used for the temperature sensor. Defaults to -1 |
humiditySensorId | the id that should be used for the humidity sensor. Defaults to -1 |
◆ begin()
bool Adafruit_AM2320::begin |
( |
| ) |
|
Setups the hardware.
- Returns
- true
◆ readTemperature()
float Adafruit_AM2320::readTemperature |
( |
| ) |
|
read the temperature from the device
- Returns
- the temperature reading as a floating point value
◆ readHumidity()
float Adafruit_AM2320::readHumidity |
( |
| ) |
|
read the humidity from the device
- Returns
- the humidity reading as a floating point value
◆ readRegister32()
uint32_t Adafruit_AM2320::readRegister32 |
( |
uint8_t |
reg | ) |
|
read 4 bytes from a hardware register
- Parameters
-
- Returns
- the read value as a 4 byte unsigned integer
◆ crc16()
uint16_t Adafruit_AM2320::crc16 |
( |
uint8_t * |
buffer, |
|
|
uint8_t |
nbytes |
|
) |
| |
perfor a CRC check to verify data
- Parameters
-
buffer | the pointer to the data to check |
nbytes | the number of bytes to calculate the CRC over |
- Returns
- the calculated CRC
◆ temperature()
get the temperature sensor object belonging to this class
- Returns
- the temperature sensor object
◆ humidity()
get the humidity sensor object belonging to this class
- Returns
- the humidity sensor object
The documentation for this class was generated from the following files: