![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
carte esclave Petit Robot
Dependencies: mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr
Diff: main.cpp
- Revision:
- 44:381ecf63e6ab
- Parent:
- 43:7fff7f4d79a1
- Child:
- 45:3cb347342a0d
--- 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;