David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: turn_sensor.cpp
- Revision:
- 46:f11cb4f93aac
- Parent:
- 45:e16e74bbbf8c
- Child:
- 50:517c0f0e621f
diff -r e16e74bbbf8c -r f11cb4f93aac turn_sensor.cpp --- a/turn_sensor.cpp Wed Apr 15 19:19:19 2015 +0000 +++ b/turn_sensor.cpp Wed Apr 15 21:19:22 2015 +0000 @@ -19,6 +19,11 @@ // error return; } + + // The gyro on this robot is mounted upside down; account for that here so that + // we can have counter-clockwise be a positive rotation. + gz = -gz; + rate = gz; // First figure out how much time has passed since the last update (dt)