![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
carte esclave pompe 2020 V1
Dependencies: mbed ident_crac
Diff: class_ventouse.cpp
- Revision:
- 22:f104afbecb98
- Parent:
- 21:42d6cead9cc2
- Child:
- 23:7f62f27c028f
diff -r 42d6cead9cc2 -r f104afbecb98 class_ventouse.cpp --- a/class_ventouse.cpp Sat Mar 07 17:40:59 2020 +0000 +++ b/class_ventouse.cpp Sun Mar 08 23:05:13 2020 +0000 @@ -1,18 +1,16 @@ #include "class_ventouse.h" - -//float seuil[NB_VENTOUSES] = {0.10, 0.3, 0.3, 0.3, 0.10, 0.3, 0.3, 0.3}; -float seuil[NB_VENTOUSES] = {0.1, 0.1, 0.1, 0.1, 0.10, 0.1, 0.1, 0.1}; +//valeur de seuil des capteurs de pression +float seuil[NB_VENTOUSES] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1}; #define PWM_POMPE 0.7 #define PWM_ELECTROVANNE 0.3 -Ventouse::Ventouse(PinName pinPompe, PinName pinCapteurPression, char index) : m_pinPompe(pinPompe), +/*Ventouse::Ventouse(PinName pinPompe, PinName pinCapteurPression, char index) : m_pinPompe(pinPompe), m_pinCapteurPression(pinCapteurPression), m_index(index) { m_pompe = new PwmOut(m_pinPompe); m_pression = new AnalogIn(m_pinCapteurPression); - m_pompe->period_us(20); - + m_pompe->period_us(20); m_pompe->write(0); flag_attraper = 0; @@ -21,7 +19,7 @@ etat = Attente; m_ack = 0; flag_electrovanne = 0; -} +}*/ Ventouse::Ventouse(PinName pinPompe, PinName pinElectrovanne, PinName pinCapteurPression, char index) : m_pinPompe(pinPompe), @@ -61,7 +59,6 @@ wait_ms(10.0); if(getPression()==1) { - // can.write(CANMessage(HACHEUR_GET_ATOM_ACK,&m_index,1)); etat = Attraper_ok; }else if(flag_relacher) { @@ -82,12 +79,10 @@ wait_ms(10.0); if(getPression() == 0) { - // can.write(CANMessage(HACHEUR_RELEASE_ATOM_ACK,&m_index,1)); if(flag_electrovanne) m_electrovanne->write(0); etat = Attente; } - break; - + break; } } @@ -117,7 +112,6 @@ else{ return 0; } - } bool Ventouse::getPompe()