Etienne Charbonnier
/
plant_monitoring
Plant Monitoring CS
DHT22.h@59:169324c8e604, 2020-03-25 (annotated)
- Committer:
- titi9211
- Date:
- Wed Mar 25 15:46:56 2020 +0000
- Revision:
- 59:169324c8e604
Plant Monitoring Program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
titi9211 | 59:169324c8e604 | 1 | #ifndef MBED_DHT22_H |
titi9211 | 59:169324c8e604 | 2 | #define MBED_DHT22_H |
titi9211 | 59:169324c8e604 | 3 | |
titi9211 | 59:169324c8e604 | 4 | #include "mbed.h" |
titi9211 | 59:169324c8e604 | 5 | |
titi9211 | 59:169324c8e604 | 6 | class DHT22 { |
titi9211 | 59:169324c8e604 | 7 | private: |
titi9211 | 59:169324c8e604 | 8 | int _temperature,_humidity; |
titi9211 | 59:169324c8e604 | 9 | PinName _data_pin; |
titi9211 | 59:169324c8e604 | 10 | public: |
titi9211 | 59:169324c8e604 | 11 | DHT22(PinName); |
titi9211 | 59:169324c8e604 | 12 | bool sample(); |
titi9211 | 59:169324c8e604 | 13 | int getTemperature(); |
titi9211 | 59:169324c8e604 | 14 | int getHumidity(); |
titi9211 | 59:169324c8e604 | 15 | }; |
titi9211 | 59:169324c8e604 | 16 | |
titi9211 | 59:169324c8e604 | 17 | #endif |