|
|
@ -22,8 +22,8 @@ namespace Akela {
|
|
|
|
uint8_t Heatmap::heatmap[ROWS][COLS];
|
|
|
|
uint8_t Heatmap::heatmap[ROWS][COLS];
|
|
|
|
uint16_t Heatmap::totalKeys;
|
|
|
|
uint16_t Heatmap::totalKeys;
|
|
|
|
uint8_t Heatmap::highestCount;
|
|
|
|
uint8_t Heatmap::highestCount;
|
|
|
|
uint16_t Heatmap::updateFrequency = 50;
|
|
|
|
uint16_t Heatmap::updateFrequency = 500;
|
|
|
|
uint16_t Heatmap::loopCount;
|
|
|
|
uint32_t Heatmap::startTime;
|
|
|
|
|
|
|
|
|
|
|
|
const float Heatmap::heatColors[][3] = {{0.0, 0.0, 0.0}, {0.1, 1, 0.1}, {1, 1, 0.1}, {1, 0.1, 0.1}};
|
|
|
|
const float Heatmap::heatColors[][3] = {{0.0, 0.0, 0.0}, {0.1, 1, 0.1}, {1, 1, 0.1}, {1, 0.1, 0.1}};
|
|
|
|
|
|
|
|
|
|
|
@ -104,12 +104,11 @@ namespace Akela {
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
Heatmap::update (void) {
|
|
|
|
Heatmap::update (void) {
|
|
|
|
loopCount++;
|
|
|
|
if (startTime && (millis () - startTime) < updateFrequency)
|
|
|
|
|
|
|
|
|
|
|
|
if (loopCount < updateFrequency)
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
loopCount = 0;
|
|
|
|
startTime = millis ();
|
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t r = 0; r < ROWS; r++) {
|
|
|
|
for (uint8_t r = 0; r < ROWS; r++) {
|
|
|
|
for (uint8_t c = 0; c < COLS; c++) {
|
|
|
|
for (uint8_t c = 0; c < COLS; c++) {
|
|
|
|
uint8_t cap = max(totalKeys, 1);
|
|
|
|
uint8_t cap = max(totalKeys, 1);
|
|
|
|