Romain Ame
/
Timer71pt
Fork de Timer après le match à 61 points
Fork of Timer by
Diff: main.cpp
- Revision:
- 76:a862cb10559c
- Parent:
- 75:195dd2bb13a3
--- a/main.cpp Thu May 05 04:36:59 2016 +0000 +++ b/main.cpp Thu May 05 06:34:13 2016 +0000 @@ -1,5 +1,5 @@ #include "func.h" -#include "Map/map.h" +#include "map.h" #include "ControlleurPince.h" @@ -45,7 +45,7 @@ DigitalIn EnZ(PB_14); DigitalIn EnL(PB_13); -ControlleurPince controlleurPince(RMot, ZMot, LMot, EnR, EnZ, EnL,left_hand,right_hand); +ControlleurPince controlleurPince(RMot, ZMot, LMot, EnR, EnZ, EnL, left_hand, right_hand); Ticker ticker; //Serial logger(USBTX, USBRX); @@ -55,7 +55,6 @@ 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,34 +62,21 @@ /* Debut du programme */ int main(void) { - init(); - map m(&odo, NULL, &controlleurPince, VIOLET, 1); - m.Execute(0); - m.Execute(); - /*drapeau = 0; - init(); - - map m(&odo); - m.addObs(obsCarr (1250, 1000, 220, 220)); - m.addObs(obsCarr (1500, 750, 220, 220)); - m.addObs(obsCarr (1500, 1250, 220, 220)); - - init(); - - int cote = MAP_RIGHTSIDE; - /*map m(&odo); - m.Build(cote); - m.Execute(1000,1000); - m.Execute(1500,1000); - m.Execute(1500,1500); - m.Execute(110,1000); - - odo.GotoThet(0); roboclaw.ForwardM1(0); roboclaw.ForwardM2(0); - logger.printf ("Chemin Fini !"); + roboclaw.ResetEnc(); - while(1);*/ + init_interrupt(); + odo.setPos(110, 1000, 0); + logger.printf("Depart homologation !\n\r"); + while(START != 1); + logger.printf("GO !!\n\r"); + roboclaw.SpeedAccelDeccelPositionM1M2(accel_angle, vitesse_angle, deccel_angle, 10000, accel_angle, vitesse_angle, deccel_angle, 10000, 1); + logger.printf("Faut avancer !!\n\r"); + while(1); + //odo.GotoXY(1000, 1000); + //odo.GotoXY(500, 1500); + } void init(void) @@ -98,24 +84,25 @@ logger.baud(9600); logger.printf("Hello from main !\n\r"); - wait(0.5); - controlleurPince.init(); - wait(0.5); - controlleurPince.home(); - - //depart(); init_interrupt(); - wait_ms(1); - while (CAMP == 0); - while (CAMP == 1); - - //while(START==0); + + SCouleur = VERT; + LEDV = 1; + LEDR = 0; + + odo.setPos(110, 1000, 0); + roboclaw.ResetEnc(); + roboclaw.ForwardM1(0); + roboclaw.ForwardM2(0); + wait_ms(500); + depart(); + wait_ms(100); + while(START==0); logger.printf("End init\n\r"); } void update_main(void) { odo.update_odo(); - if (front_Sharp_activated) - checkAround(); + //checkAround(); } \ No newline at end of file