carte esclave petit robot

Dependencies:   mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr

Files at this revision

API Documentation at this revision

Comitter:
Artiom
Date:
Sun May 26 10:51:35 2019 +0000
Parent:
43:7fff7f4d79a1
Commit message:

Changed in this revision

actions_Gr.lib Show annotated file Show diff for this revision Revisions of this file
actions_Pr.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
--- a/actions_Gr.lib	Sat May 25 15:40:31 2019 +0000
+++ b/actions_Gr.lib	Sun May 26 10:51:35 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/CRAC-Team/code/actions_Gr/#283d66d5c3b9
+https://os.mbed.com/teams/CRAC-Team/code/actions_Gr/#dfff2e200d0c
--- a/actions_Pr.lib	Sat May 25 15:40:31 2019 +0000
+++ b/actions_Pr.lib	Sun May 26 10:51:35 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/CRAC-Team/code/actions_Pr/#40ac0603f9df
+https://os.mbed.com/teams/CRAC-Team/code/actions_Pr/#15fd3bb5adb5
--- a/main.cpp	Sat May 25 15:40:31 2019 +0000
+++ b/main.cpp	Sun May 26 10:51:35 2019 +0000
@@ -15,6 +15,8 @@
 
 char cote=0;
 
+unsigned short distance_recalage,distance_revenir;
+unsigned short  distance_goldenium;
 
 void canProcessRx(void);
 
@@ -99,8 +101,13 @@
 
         fifo_couleur();
         ascenseur();
-        convoyeur_gauche();
-        convoyeur_droit();
+        if(cote) {
+            convoyeur_gauche_violet();
+            convoyeur_droit_violet();
+        } else {
+            convoyeur_gauche_jaune(); //ok
+            convoyeur_droit_jaune(); //ok
+        }
 
 #endif
 
@@ -180,8 +187,8 @@
                 can.write(msgTx);
                 SendAck(ACKNOWLEDGE_TELEMETRE,RECEPTION_RECALAGE);
                 break;
-                
-        case DATA_TELEMETRE_LOGIQUE:
+
+            case DATA_TELEMETRE_LOGIQUE:
                 msgTx.id=RECEPTION_TELEMETRE_LOGIQUE; // tx Valeur Telemetre1
                 msgTx.len=4;
                 msgTx.format=CANStandard;
@@ -211,10 +218,8 @@
             case HACHEUR_RELEASE_ATOM_ACK :
                 status_pompe &= ~(0x01 << msgRxBuffer[FIFO_lecture].data[0]);
                 break;
-                
-            case HACHEUR_ETAT_CONTACTS : 
-                status_contact = msgRxBuffer[FIFO_lecture].data[0];
-                break;
+
+
 
 //-------------------------------------------------------------------------------------------------------------------------------------------
 
@@ -222,12 +227,12 @@
 
             case PRESENTOIR_AVANT:
                 fpresentoir_avant=1;
+            
                 break;
 
             case GABARIT_ROBOT:
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);
                 gabarit_robot();
-
                 SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION);
                 break;
 
@@ -257,6 +262,8 @@
 
             case ACCELERATEUR_AVANT:
                 faccelerateur_avant=1;
+                distance_recalage=msgRxBuffer[FIFO_lecture].data[0]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[1])<<8);
+                distance_revenir=msgRxBuffer[FIFO_lecture].data[2]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[3])<<8);
                 break;
 
             case ACCELERATEUR_ARRIERE:
@@ -265,6 +272,7 @@
 
             case GOLDENIUM_AVANT:
                 fgoldenium_avant=1;
+                distance_goldenium=msgRxBuffer[FIFO_lecture].data[0]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[1])<<8);
                 break;
 
             case GOLDENIUM_ARRIERE:
@@ -288,7 +296,7 @@
                 break;
 
 
-            
+
 
             case ARRIERE_RELACHE:
                 farriere_relache=1;
@@ -337,6 +345,10 @@
                 flag_ascenseur = msgRxBuffer[FIFO_lecture].data[0];
                 break;
 
+            case HACHEUR_ETAT_CONTACTS :
+                status_contact = msgRxBuffer[FIFO_lecture].data[0];
+                break;
+
 #endif
         }
         FIFO_lecture=(FIFO_lecture+1)%SIZE_FIFO;
--- a/main.h	Sat May 25 15:40:31 2019 +0000
+++ b/main.h	Sun May 26 10:51:35 2019 +0000
@@ -32,4 +32,7 @@
 extern CAN can;
 extern char cote;
 extern Serial pc;
+
+extern unsigned short distance_recalage,distance_revenir;
+extern unsigned short distance_goldenium;
 #endif
\ No newline at end of file