ARES
/
Timer
Time is good
Fork of Robot2016_2-0 by
Diff: main.cpp
- Revision:
- 75:195dd2bb13a3
- Parent:
- 74:07cdad6e861a
- Child:
- 76:a862cb10559c
diff -r 07cdad6e861a -r 195dd2bb13a3 main.cpp --- a/main.cpp Thu May 05 05:49:41 2016 +0200 +++ b/main.cpp Thu May 05 04:36:59 2016 +0000 @@ -1,5 +1,5 @@ #include "func.h" -#include "map.h" +#include "Map/map.h" #include "ControlleurPince.h" @@ -24,8 +24,8 @@ DigitalOut blanc(PC_6); DigitalOut rouge(PC_8); -//AX12 left_hand(PA_9, PA_10, 4, 250000); -//AX12 right_hand(PA_9, PA_10, 1, 250000); +AX12 left_hand(PA_9, PA_10, 3, 250000); +AX12 right_hand(PA_9, PA_10, 2, 250000); /* Sharp */ AnalogIn capt1(PA_4); @@ -45,7 +45,7 @@ DigitalIn EnZ(PB_14); DigitalIn EnL(PB_13); -ControlleurPince controlleurPince(RMot, ZMot, LMot, EnR, EnZ, EnL); +ControlleurPince controlleurPince(RMot, ZMot, LMot, EnR, EnZ, EnL,left_hand,right_hand); Ticker ticker; //Serial logger(USBTX, USBRX); @@ -55,6 +55,7 @@ int SIMON_i = 0, SIMON_state = 0, SCouleur = VERT, SStart = 0, SSchema = 1; bool SIMON_EL = false, SIMON_EZ = false, SIMON_ER = false, SGauche = false, SDevant = false, SDroite = false; +bool front_Sharp_activated = true; void init(void); void update_main(void); @@ -63,7 +64,7 @@ int main(void) { init(); - map m(&odo, NULL, &controlleurPince, VERT, 1); + map m(&odo, NULL, &controlleurPince, VIOLET, 1); m.Execute(0); m.Execute(); /*drapeau = 0; @@ -97,6 +98,9 @@ logger.baud(9600); logger.printf("Hello from main !\n\r"); + wait(0.5); + controlleurPince.init(); + wait(0.5); controlleurPince.home(); //depart(); @@ -112,5 +116,6 @@ void update_main(void) { odo.update_odo(); - checkAround(); + if (front_Sharp_activated) + checkAround(); } \ No newline at end of file