mechatronics drive

Dependencies:   BNO055_fusion mbed

Fork of DEMO3 by Edwin Cho

Committer:
alaurens
Date:
Sun Mar 20 20:32:52 2016 +0000
Revision:
6:59f239c83de4
Parent:
5:c89308dc1827
added 3 files drive.h drive.cpp and main.h mains contains constants defined for my other function.; drive.cpp contains 3 function drivestraightS(sideways) driveStraightD(down) and rotate

Who changed what in which revision?

UserRevisionLine numberNew contents of line
12104404 0:96d6eb224379 1 #include "LOCALIZE.h"
12104404 0:96d6eb224379 2
12104404 0:96d6eb224379 3 //Serial pc(p13, p14);
12104404 0:96d6eb224379 4 Serial pc(USBTX, USBRX);
12104404 0:96d6eb224379 5
12104404 0:96d6eb224379 6 I2C i2c1(p28, p27);
12104404 0:96d6eb224379 7 I2C i2c2(p9, p10);
12104404 0:96d6eb224379 8 LOCALIZE loc(i2c1, i2c2, p26);
12104404 0:96d6eb224379 9 LOCALIZE_xya xya;
12104404 0:96d6eb224379 10
12104404 0:96d6eb224379 11 DigitalOut led1(LED1);
12104404 0:96d6eb224379 12 DigitalOut led2(LED2);
12104404 0:96d6eb224379 13 DigitalOut led3(LED3);
12104404 0:96d6eb224379 14 DigitalOut led4(LED4);
12104404 0:96d6eb224379 15
12104404 0:96d6eb224379 16 int main()
12104404 0:96d6eb224379 17 {
12104404 0:96d6eb224379 18 pc.baud(9600);
12104404 4:d70375cfa533 19 pc.printf("Initialized Localization: %d\n",loc.init());
12104404 0:96d6eb224379 20 while(1) {
12104404 1:8966a48ce8d5 21 //loc.get_angle(&xya);
12104404 1:8966a48ce8d5 22 loc.get_xy(&xya);
12104404 1:8966a48ce8d5 23 pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a);
12104404 5:c89308dc1827 24 //pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a);
12104404 3:c58eb4be51de 25 //pc.printf("%c%c%c%c\n",xya.x,xya.y,xya.a/10,xya.a%10);
12104404 0:96d6eb224379 26 }
12104404 0:96d6eb224379 27 }