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: logger.h
- Revision:
- 37:23000a47ed2b
- Child:
- 40:6fa672be85ec
diff -r ccb03b734737 -r 23000a47ed2b logger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logger.h Thu Mar 06 05:11:46 2014 +0000 @@ -0,0 +1,28 @@ +#pragma once + +#include <stdint.h> + +#define LOGGER_SIZE 2000 + +struct LogEntry +{ + //int16_t cos; + //int16_t sin; + int16_t x; + int16_t y; +}; + +class Logger +{ + public: + Logger(); + void log(); + void dump(); + bool isFull(); + + LogEntry entries[LOGGER_SIZE]; + + // The index of the next entry to write to. + int32_t entryIndex; +}; +