Lit le port analogique du capteur RG100 et convertit la valeur lue en irradiance.
RG100.h@1:b6d17e57602b, 2019-06-29 (annotated)
- Committer:
- Station_Meteo_Laos
- Date:
- Sat Jun 29 12:34:11 2019 +0000
- Revision:
- 1:b6d17e57602b
- Parent:
- 0:2971a232b9b1
Lite le c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Station_Meteo_Laos | 0:2971a232b9b1 | 1 | #ifndef MBED_RG100_H |
Station_Meteo_Laos | 0:2971a232b9b1 | 2 | #define MBED_RG100_H |
Station_Meteo_Laos | 0:2971a232b9b1 | 3 | |
Station_Meteo_Laos | 0:2971a232b9b1 | 4 | #include "mbed.h" |
Station_Meteo_Laos | 0:2971a232b9b1 | 5 | |
Station_Meteo_Laos | 0:2971a232b9b1 | 6 | class RG100 |
Station_Meteo_Laos | 0:2971a232b9b1 | 7 | { |
Station_Meteo_Laos | 0:2971a232b9b1 | 8 | public: |
Station_Meteo_Laos | 1:b6d17e57602b | 9 | //constructeur de la classe |
Station_Meteo_Laos | 0:2971a232b9b1 | 10 | RG100(PinName analog_pin, float coeff_etalon); |
Station_Meteo_Laos | 1:b6d17e57602b | 11 | //méthode de lecture du capteur |
Station_Meteo_Laos | 0:2971a232b9b1 | 12 | bool read(); |
Station_Meteo_Laos | 0:2971a232b9b1 | 13 | |
Station_Meteo_Laos | 1:b6d17e57602b | 14 | //Variable public utilisée pour stocker le résultat de la conversion |
Station_Meteo_Laos | 0:2971a232b9b1 | 15 | float irradiance; |
Station_Meteo_Laos | 0:2971a232b9b1 | 16 | |
Station_Meteo_Laos | 0:2971a232b9b1 | 17 | private: |
Station_Meteo_Laos | 1:b6d17e57602b | 18 | //Appel du constructeur AnalogIn pour lire le port du capteur RG100 |
Station_Meteo_Laos | 0:2971a232b9b1 | 19 | AnalogIn analog; |
Station_Meteo_Laos | 1:b6d17e57602b | 20 | //Variable privé pour stocker le coeff d'étalonage du capteur RG100 |
Station_Meteo_Laos | 0:2971a232b9b1 | 21 | float coef_etalon; |
Station_Meteo_Laos | 0:2971a232b9b1 | 22 | }; |
Station_Meteo_Laos | 0:2971a232b9b1 | 23 | |
Station_Meteo_Laos | 0:2971a232b9b1 | 24 | #endif |