upm
0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
|
API support for the Grove CO2 sensor. More...
This class implements support for the Grove CO2 sensor.
Its CO2 detection range is 0-2,000 ppm. It requires a 2-3 minute warm-up time before reporting valid data.
Public Member Functions | |
synchronized void | delete () |
MHZ16 (int uart) | |
boolean | dataAvailable (long millis) |
int | readData (byte[] buffer) |
int | writeData (byte[] buffer) |
boolean | setupTty (int baud) |
boolean | setupTty () |
boolean | verifyPacket (byte[] pkt) |
boolean | getData () |
int | getGas () |
int | getTemperature () |
void | calibrateZeroPoint () |
void calibrateZeroPoint | ( | ) |
Sets the zero point of the sensor
boolean dataAvailable | ( | long | millis | ) |
Checks to see if there is data available for reading
millis | Number of milliseconds to wait; 0 means no waiting. |
boolean getData | ( | ) |
Queries the sensor and gets the gas (CO2) concentration and temperature data. Should be called before other "get" functions.
int getGas | ( | ) |
Returns the gas (CO2) concentration data.
int getTemperature | ( | ) |
Returns the temperature data.
boolean setupTty | ( | int | baud | ) |
Sets up proper tty I/O modes and the baud rate. The default baud rate is 9,600 (B9600).
baud | Desired baud rate. |