carte esclave pompe 2020 V1

Dependencies:   mbed ident_crac

Committer:
maximilienlv
Date:
Sun Mar 08 23:05:13 2020 +0000
Revision:
22:f104afbecb98
Parent:
21:42d6cead9cc2
Child:
23:7f62f27c028f
optimisation du code des pompes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marwanesaich 0:84a8c24e29ae 1 #ifndef CLASS_VENTOUSE_H
marwanesaich 0:84a8c24e29ae 2 #define CLASS_VENTOUSE_H
kyxstark 12:2491a5b0f90b 3 #include "extern.h"
kyxstark 8:a25a9c22ba91 4
maximilienlv 21:42d6cead9cc2 5 #define NB_VENTOUSES 6
kyxstark 8:a25a9c22ba91 6
marwanesaich 0:84a8c24e29ae 7
marwanesaich 2:4cc8fa2f64be 8 typedef enum {Attente, Attraper, Attraper_ok, Relacher, Relacher_ok} type_etat ;
marwanesaich 0:84a8c24e29ae 9
marwanesaich 0:84a8c24e29ae 10 class Ventouse
marwanesaich 0:84a8c24e29ae 11 {
marwanesaich 0:84a8c24e29ae 12 public:
maximilienlv 22:f104afbecb98 13 //Ventouse(PinName pinPompe, PinName pinCapteurPression, char index);
marwanesaich 2:4cc8fa2f64be 14 Ventouse(PinName pinPompe, PinName pinElectrovanne, PinName pinCapteurPression, char index);
marwanesaich 0:84a8c24e29ae 15
marwanesaich 2:4cc8fa2f64be 16 void automate();
marwanesaich 2:4cc8fa2f64be 17 void action(bool action);
marwanesaich 0:84a8c24e29ae 18 void attraper();
marwanesaich 0:84a8c24e29ae 19 void relacher();
marwanesaich 0:84a8c24e29ae 20
marwanesaich 2:4cc8fa2f64be 21 bool getPression();
marwanesaich 2:4cc8fa2f64be 22 bool getPompe();
marwanesaich 0:84a8c24e29ae 23
marwanesaich 0:84a8c24e29ae 24 void setPompe(float val);
kyxstark 8:a25a9c22ba91 25 void setElectrovanne(int val);
marwanesaich 0:84a8c24e29ae 26
marwanesaich 0:84a8c24e29ae 27
marwanesaich 0:84a8c24e29ae 28 private:
marwanesaich 0:84a8c24e29ae 29 PwmOut* m_pompe;
maximilienlv 19:952208276c63 30 PwmOut* m_electrovanne;
marwanesaich 0:84a8c24e29ae 31 AnalogIn* m_pression;
marwanesaich 0:84a8c24e29ae 32
marwanesaich 5:176e7353ba1c 33 bool flag_electrovanne;
marwanesaich 2:4cc8fa2f64be 34 bool flag_attraper;
marwanesaich 2:4cc8fa2f64be 35 bool flag_relacher;
marwanesaich 2:4cc8fa2f64be 36 type_etat etat;
marwanesaich 2:4cc8fa2f64be 37 char m_index;
marwanesaich 2:4cc8fa2f64be 38 char m_ack;
marwanesaich 5:176e7353ba1c 39
marwanesaich 0:84a8c24e29ae 40 PinName m_pinPompe, m_pinElectrovanne, m_pinCapteurPression;
marwanesaich 0:84a8c24e29ae 41 };
marwanesaich 0:84a8c24e29ae 42
maximilienlv 21:42d6cead9cc2 43 #endif //CLASS_VENTOUSE_H