Programme carte strategie (disco)

Dependencies:   mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Revision:
5:dcd817534b57
Parent:
4:88431b537477
Child:
7:dcce34c7e06e
--- a/Robots/Strategie_small.cpp	Sun Apr 17 14:03:03 2016 +0000
+++ b/Robots/Strategie_small.cpp	Sat Apr 23 09:16:14 2016 +0000
@@ -22,26 +22,26 @@
                 AX12_setGoal(AX12_ID_BRAS_BASE_INV,200,0x0FF);
                 AX12_processChange();
             } else {
-                
+                AX12_setGoal(AX12_ID_BRAS_BASE,140,0x0FF);
+                AX12_processChange();
             }
         break;
         case 102://Remonter bras moiter
             if(InversStrat == 1) {//Si c'est inversé, On utilise le bras coté gauche
-                AX12_setGoal(AX12_ID_BRAS_BASE_INV,270,0x0FF);
+                AX12_setGoal(AX12_ID_BRAS_BASE_INV,220,0x0FF);
                 AX12_processChange();
             } else {
-                
+                AX12_setGoal(AX12_ID_BRAS_BASE,100,0x0FF);
+                AX12_processChange();
             }
         break;
         case 103://Lacher les poissons
             if(InversStrat == 1) {//Si c'est inversé, On utilise le bras coté gauche
-                AX12_setGoal(AX12_ID_BRAS_BASE_INV,210,0x0FF);
-                AX12_processChange();
-                wait_ms(500);//TODO ajouter une action pour remplacer l'attente bloquante
                 AX12_setGoal(AX12_ID_BRAS_RELACHEUR_INV,90);//Ouverture du bras
                 AX12_processChange();
             } else {
-                
+                AX12_setGoal(AX12_ID_BRAS_RELACHEUR,250);//Ouverture du bras
+                AX12_processChange();
             }
         break;
         case 104://Rentrer le bras
@@ -50,9 +50,19 @@
                 AX12_setGoal(AX12_ID_BRAS_RELACHEUR_INV,160);//fermer le bras
                 AX12_processChange();
             } else {
-                
+                AX12_setGoal(AX12_ID_BRAS_BASE,55,0x0FF);
+                AX12_setGoal(AX12_ID_BRAS_RELACHEUR,200);//fermer le bras
+                AX12_processChange();
             }
         break;
+        case 105:
+            //AX12_setGoal(AX12_ID_BRAS_RELACHEUR_INV,160);//fermer le bras
+            //AX12_processChange();
+        break;
+        case 106:
+            //AX12_setGoal(AX12_ID_BRAS_RELACHEUR_INV,160);//fermer le bras
+            //AX12_processChange();
+        break;
         default:
             return 0;//L'action n'existe pas, il faut utiliser le CAN
         
@@ -69,8 +79,18 @@
     /**
     On enregistre les id des AX12 présent sur la carte
     **/
-    AX12_register(1,0x0FF);
-    AX12_register(2);
+    AX12_register(1,AX12_SERIAL1,0x0FF);
+    AX12_register(2,AX12_SERIAL1);
+    AX12_register(18,AX12_SERIAL1);
+    AX12_register(4,AX12_SERIAL2);
+    AX12_register(16,AX12_SERIAL2);
+    AX12_register(17,AX12_SERIAL2,0x0FF);
+    /*
+    AX12_setGoal(AX12_ID_BRAS_BASE_INV,278,0x0FF);
+    AX12_setGoal(AX12_ID_BRAS_RELACHEUR_INV,160);//fermer le bras
+    AX12_setGoal(AX12_ID_BRAS_BASE,278,0x0FF);
+    AX12_setGoal(AX12_ID_BRAS_RELACHEUR,160);//fermer le bras
+    AX12_processChange();*/
 }
 
 /****************************************************************************************/