libs_YSI_example
Dependencies: lib_LCD_i2c_SPTLYI lib_LCD_oem lib_SHT11
main.cpp@5:b769e3bd31cb, 2018-09-07 (annotated)
- Committer:
- YSI
- Date:
- Fri Sep 07 13:04:38 2018 +0000
- Revision:
- 5:b769e3bd31cb
- Parent:
- 2:317ee4c7d7f6
update all
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YSI | 0:97f794a03fd5 | 1 | #include "mbed.h" |
YSI | 0:97f794a03fd5 | 2 | #include "lib_SHT11.h" |
YSI | 1:71eaad8c33dc | 3 | #include "lib_LCD_oem_ELCD.h" |
YSI | 0:97f794a03fd5 | 4 | #include "lib_LCD_i2c_SPTLYI.h" |
YSI | 0:97f794a03fd5 | 5 | |
YSI | 0:97f794a03fd5 | 6 | LCD_I2C LCD; |
YSI | 2:317ee4c7d7f6 | 7 | //LCD_OEM LCD; |
YSI | 0:97f794a03fd5 | 8 | SHT11 capteur_HT; |
YSI | 0:97f794a03fd5 | 9 | |
YSI | 0:97f794a03fd5 | 10 | int main() |
YSI | 0:97f794a03fd5 | 11 | { |
YSI | 0:97f794a03fd5 | 12 | float Temperature_mesuree=0.0, Humidite_mesuree=0.0; |
YSI | 0:97f794a03fd5 | 13 | |
YSI | 0:97f794a03fd5 | 14 | while(1) |
YSI | 0:97f794a03fd5 | 15 | { |
YSI | 0:97f794a03fd5 | 16 | if((Temperature_mesuree != capteur_HT.lire_T()) || (Humidite_mesuree != capteur_HT.lire_H())) |
YSI | 0:97f794a03fd5 | 17 | { |
YSI | 0:97f794a03fd5 | 18 | capteur_HT.lire_T_H(&Temperature_mesuree, &Humidite_mesuree); |
YSI | 2:317ee4c7d7f6 | 19 | LCD.clear(); |
YSI | 2:317ee4c7d7f6 | 20 | LCD.print("T=%f H=%f", Temperature_mesuree, Humidite_mesuree); |
YSI | 0:97f794a03fd5 | 21 | } |
YSI | 2:317ee4c7d7f6 | 22 | wait(2.0); |
YSI | 0:97f794a03fd5 | 23 | } |
YSI | 0:97f794a03fd5 | 24 | } |