MtSense01 Easy use interface
MtSense01.h@2:9a301d7b8f44, 2018-04-27 (annotated)
- Committer:
- johnathanlyu
- Date:
- Fri Apr 27 09:44:05 2018 +0000
- Revision:
- 2:9a301d7b8f44
- Parent:
- 1:26745d857755
follow sensor library update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
johnathanlyu | 0:c95ce83462a0 | 1 | #ifndef MTSENSE01_H |
johnathanlyu | 0:c95ce83462a0 | 2 | #define MTSENSE01_H |
johnathanlyu | 0:c95ce83462a0 | 3 | |
johnathanlyu | 0:c95ce83462a0 | 4 | #include "mbed.h" |
johnathanlyu | 0:c95ce83462a0 | 5 | #include "BMP280.h" |
johnathanlyu | 0:c95ce83462a0 | 6 | #include "SHT2X.h" |
johnathanlyu | 0:c95ce83462a0 | 7 | |
johnathanlyu | 0:c95ce83462a0 | 8 | class MtSense01 { |
johnathanlyu | 0:c95ce83462a0 | 9 | public: |
johnathanlyu | 2:9a301d7b8f44 | 10 | MtSense01(I2C& i2c, Serial& pc); |
johnathanlyu | 0:c95ce83462a0 | 11 | int Initial(); |
johnathanlyu | 0:c95ce83462a0 | 12 | int readData(float* pTemperature = NULL, int* pPressure = NULL, float* pHumidity = NULL); |
johnathanlyu | 0:c95ce83462a0 | 13 | float getTemperature(); |
johnathanlyu | 0:c95ce83462a0 | 14 | float getPressure(); |
johnathanlyu | 0:c95ce83462a0 | 15 | float getHumidity(); |
johnathanlyu | 0:c95ce83462a0 | 16 | |
johnathanlyu | 0:c95ce83462a0 | 17 | protected: |
johnathanlyu | 0:c95ce83462a0 | 18 | SHT2X sht21; |
johnathanlyu | 0:c95ce83462a0 | 19 | BMP280 bmp280; |
johnathanlyu | 0:c95ce83462a0 | 20 | private: |
johnathanlyu | 0:c95ce83462a0 | 21 | |
johnathanlyu | 0:c95ce83462a0 | 22 | }; |
johnathanlyu | 0:c95ce83462a0 | 23 | |
johnathanlyu | 0:c95ce83462a0 | 24 | #endif |