Code to run the microcontrollers on the R5 competition bot
Dependencies: LineSensors mbed
Diff: r5map.h
- Revision:
- 17:5046b27f5441
- Child:
- 18:2bd595af51d2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/r5map.h Sat Apr 18 03:02:28 2015 +0000 @@ -0,0 +1,27 @@ +#include "DriveController.h" + +int main() +{ + DriveController myWheels; + + myWheels.sensors.setThreshold(); + + wait(10); + + myWheels.treadSpeed1.period_us(50); //setting pwm period for all wheels to 20khz + myWheels.treadSpeed2.period_us(50); + + //spinTest(); + + while(true) //test loop + { + myWheels.move(FORWARD); + wait(0.5); + myWheels.move(FORWARD); + wait(0.5); + myWheels.rotate((myWheels.orient+2)%4); + wait(0.5); + } + + return 0; +} \ No newline at end of file