Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MQ135.h
- Revision:
- 0:59011d343342
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MQ135.h Fri Jun 16 15:01:55 2017 +0000 @@ -0,0 +1,39 @@ +/*************************************************** + This is a library for MQ135 gas sensor + + Written by Nerea Gómez. + + ****************************************************/ + +#ifndef MBED_MQ135_H +#define MBED_MQ135_H + + +#include "mbed.h" + +class MQ135 { + public: + MQ135(PinName pin); + void initialize(); + float getPPM(); + int air_quality(); + long getRs(); + float getRsRo(); + + private: + AnalogIn _pin; + long adc_limit; + int mqR; + long rO; + float a; + float b; + long rS; + float rSrO; +}; + +#endif + + + + + \ No newline at end of file