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
logger.h
- Committer:
- DavidEGrayson
- Date:
- 2019-08-13
- Revision:
- 48:597738b77f77
- Parent:
- 40:6fa672be85ec
File content as of revision 48:597738b77f77:
#pragma once
#include <stdint.h>
#define LOGGER_SIZE 3000
struct LogEntry
{
int16_t turnAngle;
int16_t x;
int16_t y;
};
class Logger
{
public:
Logger();
void log(struct LogEntry *);
void dump();
bool isFull();
int32_t getSize() { return entryIndex; }
LogEntry entries[LOGGER_SIZE];
// The index of the next entry to write to.
uint32_t entryIndex;
};
David Grayson