David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: turn_sensor.h
- Revision:
- 50:517c0f0e621f
- Parent:
- 44:edcacba44760
- Child:
- 52:05a8e919ddb0
--- a/turn_sensor.h Wed Apr 15 21:58:21 2015 +0000 +++ b/turn_sensor.h Wed Apr 15 22:53:33 2015 +0000 @@ -8,6 +8,7 @@ public: + void reset(); void start(); void update(); @@ -32,4 +33,14 @@ uint32_t angleUnsigned; int16_t rate; uint16_t gyroLastUpdate; -}; \ No newline at end of file +}; + + +// This constant represents a turn of 45 degrees. +const int32_t turnAngle45 = 0x20000000; + +// This constant represents a turn of 90 degrees. +const int32_t turnAngle90 = turnAngle45 * 2; + +// This constant represents a turn of approximately 1 degree. +const int32_t turnAngle1 = (turnAngle45 + 22) / 45; \ No newline at end of file