Adafruit SHTC3 Library
Public Member Functions | Protected Attributes | Friends | List of all members
Adafruit_SHTC3 Class Reference

#include <Adafruit_SHTC3.h>

Public Member Functions

 Adafruit_SHTC3 (void)
 SHTC3 constructor.
 
 ~Adafruit_SHTC3 (void)
 SHTC3 destructor.
 
bool begin (TwoWire *theWire=&Wire)
 
uint16_t readID (void)
 
void reset (void)
 
void sleep (bool sleepmode)
 Brings the SHTC3 in or out of sleep mode. More...
 
void lowPowerMode (bool readmode)
 Tells the SHTC3 to read future data in low power (fast) or normal (precise) 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 SHTC3's humidity sensor. More...
 
Adafruit_Sensor * getHumiditySensor (void)
 Gets the Adafruit_Sensor object for the SHTC3'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_SHTC3_Temptemp_sensor = NULL
 Temp sensor data object.
 
Adafruit_SHTC3_Humidityhumidity_sensor
 Humidity sensor data object. More...
 

Friends

class Adafruit_SHTC3_Temp
 
class Adafruit_SHTC3_Humidity
 

Detailed Description

Driver for the Adafruit SHTC3 Temperature and Humidity breakout board.

Member Function Documentation

◆ begin()

bool Adafruit_SHTC3::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.

◆ readID()

uint16_t Adafruit_SHTC3::readID ( void  )

Gets the ID register contents.

Returns
The 16-bit ID register.

◆ reset()

void Adafruit_SHTC3::reset ( void  )

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

◆ sleep()

void Adafruit_SHTC3::sleep ( bool  sleepmode)

Brings the SHTC3 in or out of sleep mode.

Parameters
sleepmodeIf true, go into sleep mode. Else, wakeup

◆ lowPowerMode()

void Adafruit_SHTC3::lowPowerMode ( bool  readmode)

Tells the SHTC3 to read future data in low power (fast) or normal (precise)

Parameters
readmodeIf true, use low power mode for reads

◆ getEvent()

bool Adafruit_SHTC3::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_SHTC3::getTemperatureSensor ( void  )

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

Returns
Adafruit_Sensor*

◆ getHumiditySensor()

Adafruit_Sensor * Adafruit_SHTC3::getHumiditySensor ( void  )

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

Returns
Adafruit_Sensor*

Friends And Related Function Documentation

◆ Adafruit_SHTC3_Temp

friend class Adafruit_SHTC3_Temp
friend

Gives access to private members to Temp data object

◆ Adafruit_SHTC3_Humidity

friend class Adafruit_SHTC3_Humidity
friend

Gives access to private members to Humidity data object

Member Data Documentation

◆ humidity_sensor

Adafruit_SHTC3_Humidity* Adafruit_SHTC3::humidity_sensor
protected
Initial value:
=
NULL

Humidity sensor data object.


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