imunano33
0.1.1
|
Handles climate data from Nano 33 (or other) sensors. More...
#include <climate.hpp>
Public Member Functions | |
Climate ()=default | |
Default constructor. More... | |
Climate (const Climate &other)=default | |
Copy constructor. | |
Climate & | operator= (const Climate &other)=default |
Assignment operator. | |
~Climate ()=default | |
Destructor. | |
Climate (Climate &&)=default | |
Move constructor. | |
Climate & | operator= (Climate &&)=default |
Move assignment. | |
bool | dataExists () const |
Determines if climate data exists. More... | |
template<TempUnit U> | |
num_t | getTemp () const |
Gets temperature. More... | |
template<PressureUnit U> | |
num_t | getPressure () const |
Gets pressure. More... | |
num_t | getHumidity () const |
Gets relative humidity. More... | |
void | update (const num_t temp, const num_t humid, const num_t pressure) |
Updates climate data. More... | |
void | reset () |
Resets climate data. More... | |
Handles climate data from Nano 33 (or other) sensors.
Objects of this class take in data from a temperature, humidity, and pressure sensor (HTS221 for temperature and humidity and LPS22HB for pressure on the Nano 33 BLE Sense), which can be converted to other units.
This class is meant to be default initialized, then updated through the use of the update() method.
If a temperature sensor is not available, this can still be initialized, but dataExists() will be false.
|
default |
Default constructor.
Initializes with no climate data. To update climate data, call update().
|
inline |
Determines if climate data exists.
This only returns false if initialized but update() has not been called yet.
|
inline |
Gets relative humidity.
Check that this humidity measurement is valid with dataExists() first.
Unit is percent humidity.
|
inline |
Gets pressure.
Check that this pressure measurement is valid with dataExists() first.
U | Pressure unit. |
|
inline |
Gets temperature.
Check that this temperature measurement is valid with dataExists() first.
U | Temperature unit. |
|
inline |
Resets climate data.
dataExists() will be false after this is called.
|
inline |
Updates climate data.
temp | Temperature, in C |
humid | Relative humidity, in percent |
pressure | Pressure, in kPa |