Final Version from RoboticHackathon 4.-5. April 2015
Dependencies: Autopilot dillerdasker Rfid mbed
Fork of RoboticHackathon2 by
Diff: main.cpp
- Revision:
- 3:9289c1e52ca5
- Parent:
- 2:b996c95912b5
diff -r b996c95912b5 -r 9289c1e52ca5 main.cpp --- a/main.cpp Mon Apr 07 06:24:19 2014 +0000 +++ b/main.cpp Tue Apr 08 14:56:42 2014 +0000 @@ -1,25 +1,27 @@ +#include "hack_motor.h" +#include "auto_pilot.h" #include "mbed.h" #include "HCSR04.h" #include "PwmOut.h" -#include "hack_motor.h" Serial pc(USBTX, USBRX); - HCSR04 sensor(PTA13, PTD5, PTD0, PTD2); +HCSR04 sensor(PTA13, PTD5, PTD0, PTD2); -Wheel robot; +Wheel robot; int control = 0; -int L1 = 0; -int L2 = 0; +extern double L1 = 0; +extern double L2 = 0; int main(){ pc.baud(9600); + pc.printf(" speed 1, 2 & 3, frem w, bagud s, venstre a & hoejre d"); while(control == 0){ robot.init(); char c; - pc.printf(" speed 1, 2 & 3, frem w, bagud s, venstre a & hoejre d"); + { c = pc.getc(); @@ -50,16 +52,16 @@ pc.printf("w"); break; - case 0x61: - robot.left(); + case 'a': + robot.right(); pc.printf("a"); wait(0.1); robot.stop(); break; - case 0x64: - robot.right(); + case 'd': + robot.left(); pc.printf("d"); wait(0.1); robot.stop();