Time is good

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

main.cpp

Committer:
sype
Date:
2015-11-16
Revision:
0:ad9600df4a70
Child:
2:abdf8c6823a1

File content as of revision 0:ad9600df4a70:

#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);
}