David's dead reckoning code for the LVBots competition on March 6th. Uses the mbed LPC1768, DRV8835, QTR-3RC, and two DC motors with encoders.
Dependencies: PololuEncoder Pacer mbed GeneralDebouncer
Diff: turn_sensor.h
- Revision:
- 42:96671b71aac5
- Parent:
- 40:6fa672be85ec
--- a/turn_sensor.h Thu Jul 25 03:20:41 2019 +0000 +++ b/turn_sensor.h Sat Jul 27 20:58:46 2019 +0000 @@ -27,6 +27,11 @@ return (((int32_t)angleUnsigned >> 16) * 360) >> 16; } + int32_t getAngleMillidegrees() + { + return ((int64_t)(int32_t)angleUnsigned * 360000) >> 32; + } + int16_t getRate() { return rate;