6 #ifndef INCLUDE_IMUNANO33_CLIMATE_HPP_
7 #define INCLUDE_IMUNANO33_CLIMATE_HPP_
83 #ifdef IMUNANO33_EMBED
84 res = m_temp * (9.0F / 5.0F) + 32.0F;
86 res = m_temp * (9.0 / 5.0) + 32.0;
93 #ifdef IMUNANO33_EMBED
94 res = m_temp + 273.15F;
96 res = m_temp + 273.15;
123 #ifdef IMUNANO33_EMBED
124 res = m_pressure * 0.00986923266716F;
126 res = m_pressure * 0.00986923266716;
130 #ifdef IMUNANO33_EMBED
131 res = m_pressure * 7.500617F;
133 res = m_pressure * 7.500617;
137 #ifdef IMUNANO33_EMBED
138 res = m_pressure * 0.1450377377F;
140 res = m_pressure * 0.1450377377;
170 m_pressure = pressure;
178 void reset() { m_dataExists =
false; }
181 bool m_dataExists{
false};
185 num_t m_pressure = 0.0;
Contains imunano33::TempUnit and imunano33::PressureUnit enums, in addition to number type.
double num_t
Alias to number type depending on embed.
Definition: unit.hpp:34
@ MMHG
Converts pressure to millimeters of mercury.
Definition: unit.hpp:27
@ ATM
Definition: unit.hpp:25
@ KPA
Converts pressure to kilopascal.
Definition: unit.hpp:24
@ PSI
Converts pressure to pounds per square inch.
Definition: unit.hpp:28
@ CELSIUS
Converts temperature to Celsius.
Definition: unit.hpp:16
@ KELVIN
Converts temperature to Kelvin.
Definition: unit.hpp:17
@ FAHRENHEIT
Converts temperature to Fahrenheit.
Definition: unit.hpp:15
Handles climate data from Nano 33 (or other) sensors.
Definition: climate.hpp:25
Climate(const Climate &other)=default
Copy constructor.
bool dataExists() const
Determines if climate data exists.
Definition: climate.hpp:67
num_t getPressure() const
Gets pressure.
Definition: climate.hpp:115
~Climate()=default
Destructor.
num_t getTemp() const
Gets temperature.
Definition: climate.hpp:78
Climate & operator=(const Climate &other)=default
Assignment operator.
Climate(Climate &&)=default
Move constructor.
void update(const num_t temp, const num_t humid, const num_t pressure)
Updates climate data.
Definition: climate.hpp:166
Climate()=default
Default constructor.
Climate & operator=(Climate &&)=default
Move assignment.
num_t getHumidity() const
Gets relative humidity.
Definition: climate.hpp:157
void reset()
Resets climate data.
Definition: climate.hpp:178