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: Multichannel_Gas_GMXXX.h
- Revision:
- 6:52d9088d70cd
- Parent:
- 2:c836ed5bafce
- Child:
- 7:3405d48c39bd
--- a/Multichannel_Gas_GMXXX.h Fri Feb 05 18:12:57 2021 +0100 +++ b/Multichannel_Gas_GMXXX.h Wed Feb 10 19:05:31 2021 +0100 @@ -41,7 +41,8 @@ #define WARMING_UP 0xFE #define WARMING_DOWN 0xFF -class GAS_GMXXX { +class GAS_GMXXX +{ public: GAS_GMXXX(PinName sda, PinName scl, uint8_t addr = 0x08); //void begin(); @@ -50,29 +51,34 @@ void preheated(); void unPreheated(); void changeGMXXXAddr(uint8_t address = 0x08); - uint32_t measure_NO2(){ + uint32_t measure_NO2() + { return getGM102B(); }; uint32_t getGM102B(); - uint32_t measure_C2H5OH(){ + uint32_t measure_C2H5OH() + { return getGM302B(); }; uint32_t getGM302B(); #ifdef GM_402B uint32_t getGM402B(); #endif - uint32_t measure_VOC(){ + uint32_t measure_VOC() + { return getGM502B(); }; uint32_t getGM502B(); - uint32_t measure_CO(){ + uint32_t measure_CO() + { return getGM702B(); }; uint32_t getGM702B(); #ifdef GM_802B uint32_t getGM802B(); #endif - inline float calcVol(uint32_t adc) { + inline float calcVol(uint32_t adc) + { return (adc * 3.3) / GM_RESOLUTION; }; private: