carte esclave petit robot

Dependencies:   mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr

Revision:
31:29500874c1cc
Parent:
30:d034f469359e
Child:
32:e9947815c4d7
--- a/main.cpp	Wed May 22 21:49:04 2019 +0000
+++ b/main.cpp	Thu May 23 07:53:43 2019 +0000
@@ -38,15 +38,15 @@
     servo_interrupt_en(); //permettre les interuptions
 
     wait(1);//attente servo boot
-    
-    
+
+
 #ifdef ROBOT_SMALL
     pc.printf("\nPetit robot\n\n");
     gabarit_petit_robot();
 #endif
 
 
-    
+
 #ifdef ROBOT_BIG
     pc.printf("\nGros robot\n\n");
     clear(doigt,2);
@@ -68,7 +68,7 @@
 
         automate_ventouse_goldenium_arriere();
         automate_ventouse_goldenium_avant();
-        
+
         automate_ventouse_sol_avant();
         automate_ventouse_sol_arriere();
 
@@ -90,7 +90,7 @@
         automate_ventouse_goldenium_avant();
         automate_ventouse_relache_avant();
         automate_ventouse_accelerateur_avant();*/
-        
+
         fifo_couleur();
         ascenseur();
 
@@ -120,7 +120,7 @@
         int identifiant=msgRxBuffer[FIFO_lecture].id;
 
         switch(identifiant) {
-
+    
             case GLOBAL_GAME_END:
                 EtatGameEnd = 1;
                 break;
@@ -164,7 +164,7 @@
                 can.write(msgTx);
                 SendAck(ACKNOWLEDGE_TELEMETRE,RECEPTION_RECALAGE);
                 break;
-                
+
 
 
 //--------------------------------------------------------------------------ACK carte pompe----------------------------------------------
@@ -186,54 +186,46 @@
 
 //-------------------------------------------------------------------------------------------------------------------------------------------
 
-            
+
 
 #ifdef ROBOT_SMALL
-            case PRESENTOIR_AVANT:
-                fpresentoir_avant=1;
-                break;
-
-            case BALANCE_AVANT:
-                fbalance_avant=1;
-                break;
-
-            case ACCELERATEUR_AVANT:
-                faccelerateur_avant=1;
-                break;
 
-            case GOLDENIUM_AVANT:
-                fgoldenium_avant=1;
-                break;
 
-            case VENTOUSE_AV_CENTRE_BALANCE:
-                SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
-                goldenium_avant();
-                verification();
-                SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
-                break;
-
-            case AVANT_RELACHE:
-                favant_relache=1;
-                break;
 //-------------------------------------------------------------------------Actions petit robot----------------------------------------------
             case GABARIT_PETIT_ROBOT:
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
                 gabarit_petit_robot();
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
                 break;
+                
+            case PRESENTOIR_AVANT:
+                fpresentoir_avant=1;
+                break;
 
             case PRESENTOIR_ARRIERE:
                 fpresentoir_arriere=1;
                 break;
 
+            case BALANCE_AVANT:
+                fbalance_avant=1;
+                break;
+                
             case BALANCE_ARRIERE:
                 fbalance_arriere=1;
                 break;
+                
+            case ACCELERATEUR_AVANT:
+                faccelerateur_avant=1;
+                break;
 
             case ACCELERATEUR_ARRIERE:
                 faccelerateur_arriere=1;
                 break;
 
+            case GOLDENIUM_AVANT:
+                fgoldenium_avant=1;
+                break;
+                
             case GOLDENIUM_ARRIERE:
                 fgoldenium_arriere=1;
                 break;
@@ -254,6 +246,11 @@
                 fsol_arriere_relache=1;
                 break;
 
+
+            case AVANT_RELACHE:
+                favant_relache=1;
+                break;
+                
             case ARRIERE_RELACHE:
                 farriere_relache=1;
                 break;
@@ -265,6 +262,13 @@
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
                 break;
 
+            case VENTOUSE_AV_CENTRE_BALANCE:
+                SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
+                goldenium_avant();
+                verification();
+                SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
+                break;
+
             case VENTOUSE_AR_CENTRE_BALANCE:
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
                 goldenium_arriere();
@@ -272,7 +276,18 @@
                 verification();
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
                 break;
-
+                
+            case ACCELERATEUR_INSERTION_AVANT_GAUCHE:
+                SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
+                accelerateur_insertion_avant_gauche();
+                SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
+                break;
+                
+            case ACCELERATEUR_INSERTION_DERRIERE_GAUCHE :
+                SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
+                accelerateur_insertion_arriere_gauche();
+                SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
+                break;
 
 #endif