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:
2014-03-13
Revision:
38:5e93a479c244
Parent:
37:23000a47ed2b
Child:
40:6fa672be85ec

File content as of revision 38:5e93a479c244:

#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;
};