CRAC Team / Mbed 2 deprecated Carte_Pompe_V1_2020

Dependencies:   mbed ident_crac

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers class_ventouse.h Source File

class_ventouse.h

00001 #ifndef CLASS_VENTOUSE_H
00002 #define CLASS_VENTOUSE_H
00003 #include "extern.h"
00004 
00005 #define NB_VENTOUSES 6
00006 
00007 typedef enum {Attente, Attraper, Attraper_ok, Relacher, Relacher_ok} type_etat ;
00008 
00009 class Ventouse{
00010 public:
00011     Ventouse(PinName pinPompe, PinName pinElectrovanne, PinName pinCapteurPression, char index);
00012     
00013     void automate();
00014     void action(bool action);
00015     void attraper();
00016     void relacher();
00017     
00018     bool getPression();
00019     bool getPompe();
00020     
00021     void setPompe(float val);
00022     void setElectrovanne(int val);
00023     
00024 
00025 private:
00026     PwmOut* m_pompe;
00027     PwmOut* m_electrovanne;
00028     AnalogIn* m_pression;
00029     
00030     bool flag_electrovanne;
00031     bool flag_attraper;
00032     bool flag_relacher;
00033     type_etat etat;
00034     char m_index;
00035     char m_ack;
00036     
00037     PinName m_pinPompe, m_pinElectrovanne, m_pinCapteurPression;
00038 };
00039 #endif //CLASS_VENTOUSE_H