Adafruit SHT4x Library
Public Member Functions | Protected Attributes | Friends | List of all members
Adafruit_SHT4x Class Reference

#include <Adafruit_SHT4x.h>

Public Member Functions

 Adafruit_SHT4x (void)
 SHT4x constructor.
 
 ~Adafruit_SHT4x (void)
 SHT4x destructor.
 
bool begin (TwoWire *theWire=&Wire)
 
uint32_t readSerial (void)
 
bool reset (void)
 
void setPrecision (sht4x_precision_t prec)
 Sets the precision rating - more precise takes longer! More...
 
sht4x_precision_t getPrecision (void)
 Gets the precision rating - more precise takes longer! More...
 
void setHeater (sht4x_heater_t heat)
 Sets the heating setting - more heating uses more power and takes longer. More...
 
sht4x_heater_t getHeater (void)
 Gets the heating setting - more heating uses more power and takes longer. More...
 
bool getEvent (sensors_event_t *humidity, sensors_event_t *temp)
 Gets the humidity sensor and temperature values as sensor events. More...
 
Adafruit_Sensor * getTemperatureSensor (void)
 Gets the Adafruit_Sensor object for the SHT4x's temperature sensor. More...
 
Adafruit_Sensor * getHumiditySensor (void)
 Gets the Adafruit_Sensor object for the SHT4x's humidity sensor. More...
 

Protected Attributes

float _temperature
 Last reading's temperature (C)
 
float _humidity
 Last reading's humidity (percent)
 
uint16_t _sensorid_humidity
 ID number for humidity.
 
uint16_t _sensorid_temp
 ID number for temperature.
 
Adafruit_I2CDevice * i2c_dev = NULL
 Pointer to I2C bus interface.
 
Adafruit_SHT4x_Temptemp_sensor = NULL
 Temp sensor data object.
 
Adafruit_SHT4x_Humidityhumidity_sensor
 Humidity sensor data object. More...
 

Friends

class Adafruit_SHT4x_Temp
 
class Adafruit_SHT4x_Humidity
 

Detailed Description

Driver for the Adafruit SHT4x Temperature and Humidity breakout board.

Member Function Documentation

◆ begin()

bool Adafruit_SHT4x::begin ( TwoWire *  theWire = &Wire)

Initialises the I2C bus, and assigns the I2C address to us.

Parameters
theWireThe I2C bus to use, defaults to &Wire
Returns
True if initialisation was successful, otherwise False.

◆ readSerial()

uint32_t Adafruit_SHT4x::readSerial ( void  )

Gets the ID register contents.

Returns
The 32-bit ID register.

◆ reset()

bool Adafruit_SHT4x::reset ( void  )

Performs a soft reset of the sensor to put it into a known state.

Returns
True on success, false if could not communicate with chip

◆ setPrecision()

void Adafruit_SHT4x::setPrecision ( sht4x_precision_t  prec)

Sets the precision rating - more precise takes longer!

Parameters
precThe desired precision setting, will be used during reads

◆ getPrecision()

sht4x_precision_t Adafruit_SHT4x::getPrecision ( void  )

Gets the precision rating - more precise takes longer!

Returns
The current precision setting, will be used during reads

◆ setHeater()

void Adafruit_SHT4x::setHeater ( sht4x_heater_t  heat)

Sets the heating setting - more heating uses more power and takes longer.

Parameters
heatThe desired heater setting, will be used during reads

◆ getHeater()

sht4x_heater_t Adafruit_SHT4x::getHeater ( void  )

Gets the heating setting - more heating uses more power and takes longer.

Returns
The current heater setting, will be used during reads

◆ getEvent()

bool Adafruit_SHT4x::getEvent ( sensors_event_t *  humidity,
sensors_event_t *  temp 
)

Gets the humidity sensor and temperature values as sensor events.

Parameters
humiditySensor event object that will be populated with humidity data
tempSensor event object that will be populated with temp data
Returns
true if the event data was read successfully

◆ getTemperatureSensor()

Adafruit_Sensor * Adafruit_SHT4x::getTemperatureSensor ( void  )

Gets the Adafruit_Sensor object for the SHT4x's temperature sensor.

Returns
Adafruit_Sensor*

◆ getHumiditySensor()

Adafruit_Sensor * Adafruit_SHT4x::getHumiditySensor ( void  )

Gets the Adafruit_Sensor object for the SHT4x's humidity sensor.

Returns
Adafruit_Sensor*

Friends And Related Function Documentation

◆ Adafruit_SHT4x_Temp

friend class Adafruit_SHT4x_Temp
friend

Gives access to private members to Temp data object

◆ Adafruit_SHT4x_Humidity

friend class Adafruit_SHT4x_Humidity
friend

Gives access to private members to Humidity data object

Member Data Documentation

◆ humidity_sensor

Adafruit_SHT4x_Humidity* Adafruit_SHT4x::humidity_sensor
protected
Initial value:
=
NULL

Humidity sensor data object.


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