From 94e2b5a2042aceaea02b9754562b3f90d299e326 Mon Sep 17 00:00:00 2001 From: tiijay Date: Fri, 7 Nov 2025 18:16:04 +0100 Subject: [PATCH] v.0.1.2 MATRIX_ROWS & MATRIX_COLS --- .vscode/settings.json | 3 ++- lib/LedMatrix/src/LedMatrix.h | 6 +++--- src/main.cpp | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 59f3443..305defe 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,6 +4,7 @@ "font_5x7,cpp": "cpp", "map": "cpp", "format": "cpp", - "system_error": "cpp" + "system_error": "cpp", + "random": "cpp" } } \ No newline at end of file diff --git a/lib/LedMatrix/src/LedMatrix.h b/lib/LedMatrix/src/LedMatrix.h index 125c597..3e00815 100644 --- a/lib/LedMatrix/src/LedMatrix.h +++ b/lib/LedMatrix/src/LedMatrix.h @@ -3,9 +3,9 @@ using namespace std; -// #define USE_FONT_5x7 -#define USE_FONT_8x8 -// #define USE_FONT_16x16 +#define USE_FONT_5x7 +// #define USE_FONT_8x8 +// #define USE_FONT_16x16 #include #include diff --git a/src/main.cpp b/src/main.cpp index 608ffea..a9c452a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,7 +4,10 @@ #include #include -LedMatrix matrix; +const uint8_t MATRIX_ROWS = 64; +const uint8_t MATRIX_COLS = 64; + +LedMatrix matrix(MATRIX_ROWS, MATRIX_COLS); #ifdef USE_FONT_5x7 const uint8_t _fontWidthPixel = 5; @@ -27,7 +30,6 @@ void printCharMatrixSimple(char c) const u_int8_t font_height = 16; #endif const auto *fontData = fontData_.data(); - Serial.print("<"); Serial.print(c); Serial.println(">"); @@ -52,7 +54,7 @@ void printCharMatrixSimple(char c) } Serial.println(mtrx); - matrix.drawText(64 - font_height - 1, 64 - _fontWidthPixel - 1, &c, CRGB::YellowGreen); + matrix.drawText(MATRIX_COLS - _fontWidthPixel - 1, MATRIX_ROWS - font_height - 1, &c, CRGB::YellowGreen); matrix.show(); }