Permet de lire et de stocker dans des variables publiques la direction pointées par la girouette WS1080.
Dependents: test_girouette_library
GirouetteWD1080.h@3:d4d516a75ac9, 2019-05-30 (annotated)
- Committer:
- Station_Meteo_Laos
- Date:
- Thu May 30 08:38:39 2019 +0000
- Revision:
- 3:d4d516a75ac9
- Parent:
- 0:493f86ea1ecb
- Child:
- 4:dfa695d9c256
Permet de lire la girouette WD1080 et de stocker dans une variable publique (de type string ou de type int) la direction pointee par la girouette. Les 4 points cardinaux sont indiques sur le pied de ka girouette, ce sont nos references.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Station_Meteo_Laos | 0:493f86ea1ecb | 1 | #ifndef MBED_GirouetteWD1080_H |
Station_Meteo_Laos | 0:493f86ea1ecb | 2 | #define MBED_GirouetteWD1080_H |
Station_Meteo_Laos | 0:493f86ea1ecb | 3 | |
Station_Meteo_Laos | 0:493f86ea1ecb | 4 | #include "mbed.h" |
Station_Meteo_Laos | 0:493f86ea1ecb | 5 | #include "string" |
Station_Meteo_Laos | 0:493f86ea1ecb | 6 | |
Station_Meteo_Laos | 0:493f86ea1ecb | 7 | class GirouetteWD1080 |
Station_Meteo_Laos | 0:493f86ea1ecb | 8 | { |
Station_Meteo_Laos | 0:493f86ea1ecb | 9 | public: |
Station_Meteo_Laos | 0:493f86ea1ecb | 10 | GirouetteWD1080(PinName analog_pin); |
Station_Meteo_Laos | 3:d4d516a75ac9 | 11 | bool read_string(); |
Station_Meteo_Laos | 3:d4d516a75ac9 | 12 | bool read_int(); |
Station_Meteo_Laos | 0:493f86ea1ecb | 13 | |
Station_Meteo_Laos | 0:493f86ea1ecb | 14 | //char direction[3]; |
Station_Meteo_Laos | 3:d4d516a75ac9 | 15 | string direction_string; |
Station_Meteo_Laos | 3:d4d516a75ac9 | 16 | int direction_int; |
Station_Meteo_Laos | 0:493f86ea1ecb | 17 | |
Station_Meteo_Laos | 0:493f86ea1ecb | 18 | private: |
Station_Meteo_Laos | 0:493f86ea1ecb | 19 | AnalogIn girouette; |
Station_Meteo_Laos | 0:493f86ea1ecb | 20 | }; |
Station_Meteo_Laos | 0:493f86ea1ecb | 21 | |
Station_Meteo_Laos | 0:493f86ea1ecb | 22 | #endif |