gestion de servomoteur individuelement, et du message ROS associe

Dependents:   stm32_actuator_gobeur

Revision:
5:04d111f63a0f
Parent:
3:40988c59e571
diff -r de7ca80dbe4b -r 04d111f63a0f Manche_a_air.cpp
--- a/Manche_a_air.cpp	Thu Jul 08 16:43:25 2021 +0000
+++ b/Manche_a_air.cpp	Thu Jul 08 22:46:14 2021 +0000
@@ -36,11 +36,12 @@
     switch(_state)
     {
         case closed:
-            if( (_order == open && 0) ||  (  (elapsed>_timeout_auto_open) && _flag_auto_open  )  )
+            if( (_order == open && 1) ||  (  (elapsed>_timeout_auto_open) && _flag_auto_open  )  )
             {
                  _state = opening;
                  *_servo = _servo_open;
                  _time = clock_s();
+                 _order = open;
             }
             break;
         case opening:
@@ -51,11 +52,12 @@
             }
             break;
         case opened:
-            if(  (_order == close && 0) || (  (elapsed>_timeout_auto_close) && _flag_auto_close  ) )
+            if(  (_order == close && 1) || (  (elapsed>_timeout_auto_close) && _flag_auto_close  ) )
             {
                  _state = closing;
                  *_servo = _servo_close;
                  _time = clock_s();
+                 _order = close;
             }
             break;
         case closing: