ARES
/
Timer
Time is good
Fork of Robot2016_2-0 by
Diff: main.cpp
- Revision:
- 0:ad9600df4a70
- Child:
- 2:abdf8c6823a1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 16 11:32:44 2015 +0000 @@ -0,0 +1,36 @@ +#include "Odometry.h" + +#define dt 10000 + +Ticker ticker; +//Timer t; + +Odometry odo(47.4, 47.2, 231.0); + +//Serial pc(PA_9, PA_10); +//Serial pc(USBTX, USBRX); + +void update_main(void); + +int main(void) +{ + odo.setPos(0, 0, 0); + //pc.baud(115200); + //pc.printf("Hello world !\n\r"); + ticker.attach_us(&update_main,dt); // 100 Hz + wait_ms(1000); + + while(1) + { + //pc.printf("Enc1 : %6.2f\tSpeed1 :%6.2f\tEnc2 : %6.2f\tSpeed2 : %6.2f\n\r",enc1,speed1,enc2,speed2); + //pc.printf("Theta : %5d\n\r", _roboclaw.ReadEncM1(ADR)); + wait_ms(10); + } +} + +void update_main(void) +{ + odo.update_odo(); + odo.GotoXYT(100,100,0); + //pc.printf("Theta : %3.3f\n\r", odo.getTheta()*180/PI); +}