carte esclave pompe 2020 V1

Dependencies:   mbed ident_crac

Committer:
maximilienlv
Date:
Thu Mar 05 16:32:21 2020 +0000
Revision:
19:952208276c63
Parent:
12:2491a5b0f90b
Child:
21:42d6cead9cc2
carte esclave pompe 2020

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
kyxstark 8:a25a9c22ba91 5
maximilienlv 19:952208276c63 6 #define NB_VENTOUSES 8
kyxstark 8:a25a9c22ba91 7
marwanesaich 0:84a8c24e29ae 8
marwanesaich 2:4cc8fa2f64be 9 typedef enum {Attente, Attraper, Attraper_ok, Relacher, Relacher_ok} type_etat ;
marwanesaich 0:84a8c24e29ae 10
marwanesaich 0:84a8c24e29ae 11 class Ventouse
marwanesaich 0:84a8c24e29ae 12 {
marwanesaich 0:84a8c24e29ae 13 public:
marwanesaich 5:176e7353ba1c 14 Ventouse(PinName pinPompe, PinName pinCapteurPression, char index);
marwanesaich 2:4cc8fa2f64be 15 Ventouse(PinName pinPompe, PinName pinElectrovanne, PinName pinCapteurPression, char index);
marwanesaich 0:84a8c24e29ae 16
marwanesaich 2:4cc8fa2f64be 17 void automate();
marwanesaich 2:4cc8fa2f64be 18 void action(bool action);
marwanesaich 0:84a8c24e29ae 19 void attraper();
marwanesaich 0:84a8c24e29ae 20 void relacher();
marwanesaich 0:84a8c24e29ae 21
marwanesaich 2:4cc8fa2f64be 22 bool getPression();
marwanesaich 2:4cc8fa2f64be 23 bool getPompe();
marwanesaich 0:84a8c24e29ae 24
marwanesaich 0:84a8c24e29ae 25
marwanesaich 0:84a8c24e29ae 26 void setPompe(float val);
kyxstark 8:a25a9c22ba91 27 void setElectrovanne(int val);
marwanesaich 0:84a8c24e29ae 28
marwanesaich 0:84a8c24e29ae 29
marwanesaich 0:84a8c24e29ae 30
marwanesaich 0:84a8c24e29ae 31
marwanesaich 0:84a8c24e29ae 32 private:
marwanesaich 0:84a8c24e29ae 33 PwmOut* m_pompe;
maximilienlv 19:952208276c63 34 PwmOut* m_electrovanne;
maximilienlv 19:952208276c63 35 //DigitalOut* m_electrovanne;
marwanesaich 0:84a8c24e29ae 36 AnalogIn* m_pression;
marwanesaich 0:84a8c24e29ae 37
marwanesaich 5:176e7353ba1c 38 bool flag_electrovanne;
marwanesaich 2:4cc8fa2f64be 39 bool flag_attraper;
marwanesaich 2:4cc8fa2f64be 40 bool flag_relacher;
marwanesaich 2:4cc8fa2f64be 41 type_etat etat;
marwanesaich 2:4cc8fa2f64be 42 char m_index;
marwanesaich 2:4cc8fa2f64be 43 char m_ack;
marwanesaich 5:176e7353ba1c 44
marwanesaich 0:84a8c24e29ae 45 PinName m_pinPompe, m_pinElectrovanne, m_pinCapteurPression;
marwanesaich 0:84a8c24e29ae 46
marwanesaich 0:84a8c24e29ae 47
marwanesaich 0:84a8c24e29ae 48 };
marwanesaich 0:84a8c24e29ae 49
marwanesaich 0:84a8c24e29ae 50 #endif //CLASS_VENTOUSE_H
marwanesaich 0:84a8c24e29ae 51