added ledmatrix footfall line diagram
This commit is contained in:
parent
267d04488b
commit
d332a17b28
@ -2,7 +2,8 @@
|
||||
|
||||
#include "globals.h"
|
||||
|
||||
#define NUMCHARS 5
|
||||
#define NUMROWS 16
|
||||
#define NUMCOLS 96
|
||||
#define MATRIX_DISPLAY_PAGES (2) // number of display pages
|
||||
|
||||
// local Tag for logging
|
||||
@ -17,7 +18,7 @@ LEDMatrix matrix(LED_MATRIX_LA_74138, LED_MATRIX_LB_74138, LED_MATRIX_LC_74138,
|
||||
LED_MATRIX_LATCHPIN, LED_MATRIX_CLOCKPIN);
|
||||
|
||||
// Display Buffer 128 = 64 * 16 / 8
|
||||
uint8_t displaybuf[LED_MATRIX_WIDTH * LED_MATRIX_HEIGHT / NUMCHARS];
|
||||
uint8_t displaybuf[LED_MATRIX_WIDTH * LED_MATRIX_HEIGHT / 8];
|
||||
|
||||
// --- SELECT YOUR FONT HERE ---
|
||||
const FONT_INFO *ActiveFontInfo = &digital7_18ptFontInfo;
|
||||
@ -34,11 +35,11 @@ void init_matrix_display(bool reverse) {
|
||||
if (reverse)
|
||||
matrix.reverse();
|
||||
matrix.clear();
|
||||
DrawNumber(String("0"));
|
||||
matrix.drawPoint(0, NUMROWS - 1, 1);
|
||||
} // init_display
|
||||
|
||||
void refreshTheMatrixDisplay(bool nextPage) {
|
||||
static uint8_t DisplayPage = 0;
|
||||
static uint8_t DisplayPage = 0, col = 0, row = 0;
|
||||
char buff[16];
|
||||
|
||||
// if Matrixdisplay is switched off we don't refresh it to relax cpu
|
||||
@ -54,20 +55,49 @@ void refreshTheMatrixDisplay(bool nextPage) {
|
||||
DisplayPage =
|
||||
(DisplayPage >= MATRIX_DISPLAY_PAGES - 1) ? 0 : (DisplayPage + 1);
|
||||
matrix.clear();
|
||||
col = 0;
|
||||
}
|
||||
|
||||
switch (DisplayPage % MATRIX_DISPLAY_PAGES) {
|
||||
|
||||
// page 0: pax
|
||||
// page 1: time
|
||||
// page 0: number of current pax OR footfall line diagram
|
||||
// page 1: time of day
|
||||
|
||||
case 0:
|
||||
|
||||
if (cfg.countermode == 1)
|
||||
|
||||
{ // cumulative counter mode -> display total number of pax
|
||||
if (ulLastNumMacs != macs.size()) {
|
||||
ulLastNumMacs = macs.size();
|
||||
matrix.clear();
|
||||
DrawNumber(String(ulLastNumMacs));
|
||||
}
|
||||
}
|
||||
|
||||
else { // cyclic counter mode -> plot a line diagram
|
||||
|
||||
if (ulLastNumMacs != macs.size()) {
|
||||
|
||||
// next count cycle?
|
||||
if (macs.size() == 0) {
|
||||
col++;
|
||||
// display full?
|
||||
if (col >= NUMCOLS) {
|
||||
col = 0;
|
||||
matrix.clear();
|
||||
}
|
||||
} else {
|
||||
// clear previous dot
|
||||
matrix.drawPoint(col, row, 0);
|
||||
}
|
||||
|
||||
// set current dot
|
||||
ulLastNumMacs = macs.size();
|
||||
row = NUMROWS - 1 - (ulLastNumMacs / 2) % NUMROWS;
|
||||
matrix.drawPoint(col, row, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
Loading…
Reference in New Issue
Block a user