upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

API for the MQ303A Alcohol Sensor. More...

Detailed Description

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.

mq303a.jpg

Public Member Functions

synchronized void delete ()
 
 MQ303A (int pin, int heaterPin)
 
int value ()
 
void heaterEnable (boolean enable)
 

Constructor & Destructor Documentation

MQ303A ( int  pin,
int  heaterPin 
)

MQ303A constructor

Parameters
pinAnalog pin to use
heaterPinDigital pin mapped to the analog pin to use

Member Function Documentation

void heaterEnable ( boolean  enable)

Enables the heater

Parameters
enableEnables 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.

Returns
Alcohol reading

The documentation for this class was generated from the following file: