#include <Adafruit_SHT31.h>
Driver for the Adafruit SHT31-D Temperature and Humidity breakout board.
◆ Adafruit_SHT31()
Adafruit_SHT31::Adafruit_SHT31 |
( |
TwoWire * |
theWire = &Wire | ) |
|
SHT31 constructor using i2c.
- Parameters
-
◆ ~Adafruit_SHT31()
Adafruit_SHT31::~Adafruit_SHT31 |
( |
| ) |
|
Destructor to free memory in use.
◆ begin()
Initialises the I2C bus, and assigns the I2C address to us.
- Parameters
-
i2caddr | The I2C address to use for the sensor. |
- Returns
- True if initialisation was successful, otherwise False.
◆ readTemperature()
float Adafruit_SHT31::readTemperature |
( |
void |
| ) |
|
Gets a single temperature reading from the sensor.
- Returns
- A float value indicating the temperature.
◆ readHumidity()
float Adafruit_SHT31::readHumidity |
( |
void |
| ) |
|
Gets a single relative humidity reading from the sensor.
- Returns
- A float value representing relative humidity.
◆ readBoth()
bool Adafruit_SHT31::readBoth |
( |
float * |
temperature_out, |
|
|
float * |
humidity_out |
|
) |
| |
Gets a reading of both temperature and relative humidity from the sensor.
- Parameters
-
temperature_out | Where to write the temperature float. |
humidity_out | Where to write the relative humidity float. |
- Returns
- True if the read was successful, false otherwise
◆ readStatus()
uint16_t Adafruit_SHT31::readStatus |
( |
void |
| ) |
|
Gets the current status register contents.
- Returns
- The 16-bit status register.
◆ reset()
void Adafruit_SHT31::reset |
( |
void |
| ) |
|
Performs a reset of the sensor to put it into a known state.
◆ heater()
void Adafruit_SHT31::heater |
( |
bool |
h | ) |
|
Enables or disabled the heating element.
- Parameters
-
h | True to enable the heater, False to disable it. |
◆ isHeaterEnabled()
bool Adafruit_SHT31::isHeaterEnabled |
( |
| ) |
|
Return sensor heater state.
- Returns
- heater state (TRUE = enabled, FALSE = disabled)
The documentation for this class was generated from the following files: