Robot's source code
Dependencies: mbed
Diff: main.cpp
- Revision:
- 60:546d7b43333b
- Parent:
- 57:ab13f4e7a2b2
- Child:
- 62:454cd844fe1e
--- a/main.cpp Thu Apr 09 16:46:48 2015 +0000 +++ b/main.cpp Thu Apr 09 16:53:18 2015 +0000 @@ -36,15 +36,6 @@ Timer t; AX12 test(PA_9,NC,0x03,250000); - test.SetMode(0); // Position - - while(1) - { - test.SetGoal(0); - wait(1); - test.SetGoal(90); - wait(1); - } AnalogIn ain0(PA_0); AnalogIn ain1(PA_1); @@ -57,8 +48,19 @@ QEI qei_right(PB_3,PA_10,NC,1024*4,QEI::X4_ENCODING); QEI qei_left(PB_4,PB_5,NC,1024*4,QEI::X4_ENCODING); Odometry odometry(&qei_left,&qei_right,63/2.,63/2.,280); + DigitalOut led(LED1); + test.SetMode(0); // Position + + while(1) + { + test.SetGoal(0); + wait(1); + test.SetGoal(90); + wait(1); + } + /*char dataOff[] = {0}; @@ -85,7 +87,7 @@ //instanceAsserv.setGoal( (float)0,(float)0, (float)PI/2); while(!testOdo) - { + { //Asservissement : t.start(); @@ -118,7 +120,7 @@ t.reset(); t.start(); } - + /*int i=0; int nbrech = 100;