upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
UPM API for the Omega RH-USB Temperature and Humidity Sensor. More...
This module implements support for the Omega RH-USB Temperature and Humidity Sensor Probe. It connects via an integrated USB cable, and is accessed via a serial port. It is suitable for wall or duct mounting.
Public Member Functions | |
RHUSB (std::string device) | |
~RHUSB () | |
void | update () |
float | getTemperature (bool fahrenheit=false) |
float | getHumidity () |
std::string | getFirmwareID () |
Protected Member Functions | |
bool | dataAvailable (unsigned int millis) |
int | writeStr (std::string data) |
std::string | readStr (int len) |
std::string | sendCommand (std::string cmd) |
Protected Attributes | |
mraa::Uart | m_uart |
void update | ( | void | ) |
Read current values from the sensor and update internal stored values. This method must be called prior to querying any values, such as temperature or humidity.
float getTemperature | ( | bool | fahrenheit = false | ) |
Get the current temperature. update() must have been called prior to calling this method.
fahrenheit | true to return the temperature in degrees fahrenheit, false to return the temperature in degrees celcius. The default is false (degrees Celcius). |
float getHumidity | ( | void | ) |
Get the current relative humidity. update() must have been called prior to calling this method.
string getFirmwareID | ( | ) |
Get the firmware identification string.