![](/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:
- 2:9e63099cca99
- Parent:
- 1:568955af8c2b
- Child:
- 4:4a79942713fa
--- a/main.cpp Tue May 07 17:27:38 2019 +0000 +++ b/main.cpp Fri May 10 09:11:09 2019 +0000 @@ -104,40 +104,12 @@ can.attach(&canRx_ISR); // création de l'interrupt attachée à la réception sur le CAN servo_interrupt_en(); //permettre les interuptions wait(1);//attente servo boot - init_petit_robot(); + gabarit_petit_robot(); while(1) { canProcessRx(); - - presentoir_avant(); - // presentoir_arriere(); - //sol_avant(); - //goldenium_avant(); - /* - accelerateur_avant(); - accelerateur_arriere(); - - init_petit_robot(); - - goldenium_arriere(); - goldenium_avant(); - - init_petit_robot(); - - sol_avant(); - sol_arriere(); - - init_petit_robot(); - - presentoir_avant(); - presentoir_arriere(); - - init_petit_robot(); - balance_avant(); - balance_arriere(); - - */ + if(EtatGameEnd==1) { while(1); @@ -209,24 +181,80 @@ break; #ifdef ROBOT_SMALL - case INIT_PETIT_ROBOT: - init_petit_robot(); + case GABARIT_PETIT_ROBOT: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + gabarit_petit_robot(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); break; case PRESENTOIR_AVANT: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); presentoir_avant(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); break; case PRESENTOIR_ARRIERE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); presentoir_arriere(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); break; case BALANCE_AVANT: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); balance_avant(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); break; case BALANCE_ARRIERE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); balance_arriere(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + + case ACCELERATEUR_AVANT: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + accelerateur_avant(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + + case ACCELERATEUR_ARRIERE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + accelerateur_arriere(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + case GOLDENIUM_AVANT: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + balance_avant(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + + case GOLDENIUM_ARRIERE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + balance_arriere(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + case SOL_AVANT: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + sol_avant(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + + case SOL_ARRIERE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + sol_arriere(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + + case SOL_AVANT_RELACHE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + sol_avant_relache(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); + break; + + case SOL_ARRIERE_RELACHE: + SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); + sol_arriere_relache(); + SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); break; #endif