PINOUT à jour, trame CAN OK

Dependencies:   mbed ident_crac

Code carte pompe

Revision:
2:4cc8fa2f64be
Parent:
0:84a8c24e29ae
Child:
3:cf33f9d4d6ff
Child:
5:176e7353ba1c
--- a/class_ventouse.h	Tue May 07 08:33:42 2019 +0000
+++ b/class_ventouse.h	Tue May 07 13:14:29 2019 +0000
@@ -3,17 +3,20 @@
 
 #include "mbed.h"
 
+typedef enum {Attente, Attraper, Attraper_ok, Relacher, Relacher_ok} type_etat ;
 
 class Ventouse
 {
 public:
-    Ventouse(PinName pinPompe, PinName pinElectrovanne, PinName pinCapteurPression);
+    Ventouse(PinName pinPompe, PinName pinElectrovanne, PinName pinCapteurPression, char index);
     
+    void automate();
+    void action(bool action);
     void attraper();
     void relacher();
     
-    int getPression();
-    int getPompe();
+    bool getPression();
+    bool getPompe();
     
     
     void setPompe(float val);
@@ -27,6 +30,11 @@
     PwmOut* m_electrovanne;
     AnalogIn* m_pression;
     
+    bool flag_attraper;
+    bool flag_relacher;
+    type_etat etat;
+    char m_index;
+    char m_ack;
     PinName m_pinPompe, m_pinElectrovanne, m_pinCapteurPression;