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

API for the DFRobot MQ4 Gas Sensor. More...

Detailed Description

The MQ4 Gas Sensor module is useful for detecting CH4 (Methane), and natural gas concentrations in the air. It has a detection range of 100-10000 ppm.

For optimum use, it requires calibration after a pre-heat time of at least 24 hours. See the datasheet for details.

mq2-5.jpeg

Public Member Functions

synchronized void delete ()
 
 MQ4 (int gasPin)
 
String name ()
 
- Public Member Functions inherited from Gas
synchronized void delete ()
 
 Gas (int gasPin)
 
int getSampledWindow (long freqMS, short[] numberOfSamples)
 
int findThreshold (thresholdContext ctx, long threshold, short[] buffer)
 
int getSampledData (thresholdContext ctx)
 
int getSample ()
 
void printGraph (thresholdContext ctx, short resolution)
 

Constructor & Destructor Documentation

MQ4 ( int  gasPin)

MQ4 constructor

Parameters
gasPinAnalog pin where the sensor is connected

Member Function Documentation

String name ( )

Returns the name of the sensor

Inheritance diagram for MQ4:
Inheritance graph
[legend]
Collaboration diagram for MQ4:
Collaboration graph
[legend]

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