This is a library for the MQ9 gas sensor module.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

MQ9 Class Reference

MQ9 Class Reference

Class for the MQ9 sensor. More...

#include <MQ9.h>

Public Member Functions

 MQ9 (PinName const &p)
 Construct the sensor object and setup the sensor pins.
int read ()
 Update the gas concentrations from the sensor.
float getLPG_ppm ()
 Get concentration of LPG Returns the concentration of LPG as a floating number.
float getCO_ppm ()
 Get concentration of CO, Returns the concentration of CO as a floating number.
float getMethane_ppm ()
 Get concentration of Methane Returns the concentration of Methane as a floating number.

Detailed Description

Class for the MQ9 sensor.

This library is a modified version of the MQ2 library for Arduino Example:

Definition at line 14 of file MQ9.h.


Constructor & Destructor Documentation

MQ9 ( PinName const &  p )

Construct the sensor object and setup the sensor pins.

Definition at line 3 of file MQ9.cpp.


Member Function Documentation

float getCO_ppm (  )

Get concentration of CO, Returns the concentration of CO as a floating number.

Definition at line 27 of file MQ9.cpp.

float getLPG_ppm (  )

Get concentration of LPG Returns the concentration of LPG as a floating number.

Definition at line 22 of file MQ9.cpp.

float getMethane_ppm (  )

Get concentration of Methane Returns the concentration of Methane as a floating number.

Definition at line 32 of file MQ9.cpp.

int read (  )

Update the gas concentrations from the sensor.

Definition at line 10 of file MQ9.cpp.