2015-06-19 15:06:14 -04:00
|
|
|
//
|
|
|
|
// FILE: DistanceTable.h
|
|
|
|
// AUTHOR: Rob Tillaart
|
2017-07-15 11:58:10 -04:00
|
|
|
// VERSION: 0.1.2
|
2015-06-19 15:06:14 -04:00
|
|
|
// PURPOSE: memory efficient DistanceTable for Arduino
|
|
|
|
// URL:
|
|
|
|
//
|
|
|
|
// Released to the public domain
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DistanceTable_h
|
|
|
|
#define DistanceTable_h
|
|
|
|
|
|
|
|
#include "Arduino.h"
|
|
|
|
|
2017-07-15 11:58:10 -04:00
|
|
|
#define DISTANCETABLE_LIB_VERSION "0.1.2"
|
2015-06-19 15:06:14 -04:00
|
|
|
|
|
|
|
class DistanceTable
|
|
|
|
{
|
|
|
|
public:
|
2017-07-15 11:58:10 -04:00
|
|
|
explicit DistanceTable(uint8_t);
|
2015-06-19 15:06:14 -04:00
|
|
|
~DistanceTable();
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
void set(uint8_t x, uint8_t y, double value );
|
|
|
|
double get(uint8_t x, uint8_t y);
|
|
|
|
void dump();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
uint8_t _size;
|
2017-07-15 11:58:10 -04:00
|
|
|
uint16_t _store;
|
2015-06-19 15:06:14 -04:00
|
|
|
double * _distanceTable;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// --- END OF FILE ---
|