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: reckoner.h
- Revision:
- 21:c279c6a83671
- Parent:
- 13:bba5b3abd13f
- Child:
- 36:ccb03b734737
diff -r dbec34f0e76b -r c279c6a83671 reckoner.h --- a/reckoner.h Thu Feb 27 19:46:35 2014 +0000 +++ b/reckoner.h Thu Feb 27 23:20:34 2014 +0000 @@ -1,3 +1,5 @@ +#pragma once + class Reckoner { public: @@ -16,6 +18,8 @@ // or backwards due to a single encoder tick. int32_t x, y; + void reset(); + void handleTickLeftForward(); void handleTickLeftBackward(); void handleTickRightForward(); @@ -25,5 +29,3 @@ void handleRight(); void handleLeft(); }; - -extern Reckoner reckoner; \ No newline at end of file