td1
Dependencies: lib_LCD_i2c_SPTLYI mbed
lib_SHT/lib_SHT11.h@0:dca3b291558e, 2014-10-23 (annotated)
- Committer:
- mbedo
- Date:
- Thu Oct 23 09:42:24 2014 +0000
- Revision:
- 0:dca3b291558e
tp1_exo1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedo | 0:dca3b291558e | 1 | #ifndef DEF_lib_SHT11_H |
mbedo | 0:dca3b291558e | 2 | #define DEF_lib_SHT11_H |
mbedo | 0:dca3b291558e | 3 | |
mbedo | 0:dca3b291558e | 4 | #include "mbed.h" |
mbedo | 0:dca3b291558e | 5 | |
mbedo | 0:dca3b291558e | 6 | |
mbedo | 0:dca3b291558e | 7 | class SHT11 : public Ticker |
mbedo | 0:dca3b291558e | 8 | { |
mbedo | 0:dca3b291558e | 9 | public: |
mbedo | 0:dca3b291558e | 10 | SHT11(PinName pin_DATA, PinName pin_SCK, float T_C_mesure); |
mbedo | 0:dca3b291558e | 11 | |
mbedo | 0:dca3b291558e | 12 | float lire_T(void); |
mbedo | 0:dca3b291558e | 13 | float lire_H(void); |
mbedo | 0:dca3b291558e | 14 | void lire_T_H(float *, float *); |
mbedo | 0:dca3b291558e | 15 | void changer_timer_cycle(float new_Temps_cycle_mesure); |
mbedo | 0:dca3b291558e | 16 | void init(void); |
mbedo | 0:dca3b291558e | 17 | void desactiver(void); |
mbedo | 0:dca3b291558e | 18 | |
mbedo | 0:dca3b291558e | 19 | private: |
mbedo | 0:dca3b291558e | 20 | |
mbedo | 0:dca3b291558e | 21 | void start(void); |
mbedo | 0:dca3b291558e | 22 | void gestion_HT(void); |
mbedo | 0:dca3b291558e | 23 | void demande_mesure(short octet_de_commande); |
mbedo | 0:dca3b291558e | 24 | void mesure_T(void); |
mbedo | 0:dca3b291558e | 25 | void mesure_H(void); |
mbedo | 0:dca3b291558e | 26 | void mesure_T_H(void); |
mbedo | 0:dca3b291558e | 27 | void reception_mesure_T(void); |
mbedo | 0:dca3b291558e | 28 | void reception_mesure_H(void); |
mbedo | 0:dca3b291558e | 29 | void calcul_Temperature_Humidite(void); |
mbedo | 0:dca3b291558e | 30 | |
mbedo | 0:dca3b291558e | 31 | DigitalInOut DATA_HT; |
mbedo | 0:dca3b291558e | 32 | DigitalOut SCK_HT; |
mbedo | 0:dca3b291558e | 33 | Ticker Timer_cycle_mesure; |
mbedo | 0:dca3b291558e | 34 | |
mbedo | 0:dca3b291558e | 35 | unsigned int Temperature; |
mbedo | 0:dca3b291558e | 36 | unsigned int Humidite; |
mbedo | 0:dca3b291558e | 37 | unsigned etat_sht11; |
mbedo | 0:dca3b291558e | 38 | unsigned etat_cycle; |
mbedo | 0:dca3b291558e | 39 | float Temperature_mesuree; |
mbedo | 0:dca3b291558e | 40 | float Humidite_mesuree; |
mbedo | 0:dca3b291558e | 41 | float Temps_cycle_mesure; |
mbedo | 0:dca3b291558e | 42 | }; |
mbedo | 0:dca3b291558e | 43 | |
mbedo | 0:dca3b291558e | 44 | #endif |
mbedo | 0:dca3b291558e | 45 |