![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Classes et code de la partie pompe du Robot 2021
Dependencies: mbed ident_crac
bloc_monopompe.h@5:88ab89ab12ad, 2021-01-19 (annotated)
- Committer:
- smarecar
- Date:
- Tue Jan 19 07:11:38 2021 +0000
- Revision:
- 5:88ab89ab12ad
- Parent:
- 4:4bae30d48662
+com
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
goldmas | 0:253443d82cba | 1 | #ifndef _BLOC_MONOPOMPE_H |
goldmas | 0:253443d82cba | 2 | #define _BLOC_MONOPOMPE_H |
goldmas | 0:253443d82cba | 3 | |
goldmas | 0:253443d82cba | 4 | #include "mbed.h" |
goldmas | 0:253443d82cba | 5 | |
goldmas | 4:4bae30d48662 | 6 | #define PWM_STOP_POMPE 0 |
goldmas | 0:253443d82cba | 7 | #define PWM_POMPE 0.7 |
goldmas | 0:253443d82cba | 8 | #define ELEC_FERME 0 |
goldmas | 0:253443d82cba | 9 | #define ELEC_OUVERTE 1 |
goldmas | 0:253443d82cba | 10 | #define SEUIL_CPT 0.1 |
goldmas | 0:253443d82cba | 11 | |
smarecar | 5:88ab89ab12ad | 12 | // bloc_monopompe est une class qui nous permet de cree un objet contenant une pompe,une electrovanne et un capteur de pression. |
smarecar | 5:88ab89ab12ad | 13 | //Contenant des fonctions public qui nous permettrons de gerer chaque element individuelement |
goldmas | 0:253443d82cba | 14 | class bloc_monopompe |
goldmas | 0:253443d82cba | 15 | { |
goldmas | 0:253443d82cba | 16 | public : |
goldmas | 0:253443d82cba | 17 | bloc_monopompe (PinName pompe, PinName electrovanne, PinName capteur) ; |
goldmas | 0:253443d82cba | 18 | |
goldmas | 4:4bae30d48662 | 19 | void aspirer (void) ; |
goldmas | 4:4bae30d48662 | 20 | |
goldmas | 4:4bae30d48662 | 21 | void relacher (void) ; |
goldmas | 0:253443d82cba | 22 | |
goldmas | 4:4bae30d48662 | 23 | char etat_actuel (void) ; |
goldmas | 0:253443d82cba | 24 | |
goldmas | 4:4bae30d48662 | 25 | void stop_pompe (void); |
goldmas | 0:253443d82cba | 26 | |
goldmas | 0:253443d82cba | 27 | private : |
goldmas | 0:253443d82cba | 28 | |
smarecar | 5:88ab89ab12ad | 29 | PwmOut _pompe ; // attribution des types de nos objets |
goldmas | 0:253443d82cba | 30 | DigitalOut _electrovanne ; |
goldmas | 0:253443d82cba | 31 | AnalogIn _capteur ; |
goldmas | 0:253443d82cba | 32 | |
goldmas | 0:253443d82cba | 33 | float _val_cpt ; |
goldmas | 0:253443d82cba | 34 | bool _gobelet_en_place ; |
goldmas | 0:253443d82cba | 35 | }; |
goldmas | 0:253443d82cba | 36 | |
goldmas | 0:253443d82cba | 37 | #endif |