upm
0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
|
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 | |
synchronized void | delete () |
MQ303A (int pin, int heaterPin) | |
int | value () |
void | heaterEnable (boolean enable) |
MQ303A | ( | int | pin, |
int | heaterPin | ||
) |
MQ303A constructor
pin | Analog pin to use |
heaterPin | Digital pin mapped to the analog pin to use |
void heaterEnable | ( | boolean | enable | ) |
Enables the heater
enable | Enables the heater if true; otherwise, disables it |
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.