Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 14:1be2f691cbb4
- Parent:
- 13:9c62e263f245
- Child:
- 15:3d4543a6c100
--- a/main.cpp Tue May 28 06:48:54 2019 +0000 +++ b/main.cpp Tue May 28 16:26:14 2019 +0000 @@ -38,13 +38,13 @@ switch(etat) { case ATTENTE: - if(actual_gauche < past_gauche-10) + if(actual_gauche < past_gauche-30) { etat = TURN_LEFT; robot.stop(); } - if(actual_droit < past_droit-10) + if(actual_droit < past_droit-30) { etat = TURN_RIGHT; robot.stop(); @@ -55,13 +55,13 @@ case TURN_LEFT: etat_balle = BALLE_GAUCHE; - if(actual_droit < past_droit-10) + if(actual_droit < past_droit-30) { etat = VOIT_BALLE; robot.stop(); } - if(actual_gauche > past_gauche+10) + if(actual_gauche > past_gauche+30) { etat = TURN_RIGHT; robot.stop(); @@ -72,13 +72,13 @@ case TURN_RIGHT: etat_balle = BALLE_DROITE; - if(actual_gauche < past_gauche-10) + if(actual_gauche < past_gauche-30) { etat = VOIT_BALLE; robot.stop(); } - if(actual_droit > past_droit+10) + if(actual_droit > past_droit+30) { etat = TURN_LEFT; robot.stop(); @@ -89,13 +89,13 @@ case VOIT_BALLE: etat_balle = BALLE_STRAIGHT; - if(actual_gauche > past_gauche+10) + if(actual_gauche > past_gauche+30) { etat = TURN_RIGHT; robot.stop(); } - if(actual_droit > past_droit+10) + if(actual_droit > past_droit+30) { etat = TURN_LEFT; robot.stop(); @@ -118,7 +118,7 @@ robot.gobe(40); if(robot.aBalle()) { - robot.stop(); + //robot.stop(); etat = ABALLE; etat_balle = CHERCHE_BALLE; } @@ -139,7 +139,7 @@ switch(etat_balle) { case CHERCHE_BALLE: - robot.tourne(3600); + robot.tourne(100); break; case BALLE_GAUCHE: @@ -151,7 +151,7 @@ break; case BALLE_STRAIGHT: - robot.avance(100); + robot.avance((short)robot.getDist(Laser::Gauche,"mm")); break; } } \ No newline at end of file