upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
API for the MQ303A Alcohol Sensor. More...
UPM module for the MQ303A alcohol sensor. This sensor needs to be warmed up before stable results are obtained. The higher the value returned from value(), the higher the amount of alcohol detected.
Public Member Functions | |
MQ303A (int pin, int heaterPin) | |
~MQ303A () | |
int | value () |
void | heaterEnable (bool enable) |
MQ303A | ( | int | pin, |
int | heaterPin | ||
) |
MQ303A constructor
pin | Analog pin to use |
heaterPin | Digital pin mapped to the analog pin to use |
int value | ( | ) |
Gets the alcohol reading from the sensor. The value read from the analog pin is inverted. A higher returned value means a higher amount of alcohol detected.
void heaterEnable | ( | bool | enable | ) |
Enables the heater
enable | Enables the heater if true; otherwise, disables it |