v.0.1.2 MATRIX_ROWS & MATRIX_COLS

This commit is contained in:
tiijay
2025-11-07 18:16:04 +01:00
parent 5b633b3ac4
commit 94e2b5a204
3 changed files with 10 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
"font_5x7,cpp": "cpp",
"map": "cpp",
"format": "cpp",
"system_error": "cpp"
"system_error": "cpp",
"random": "cpp"
}
}

View File

@@ -3,8 +3,8 @@
using namespace std;
// #define USE_FONT_5x7
#define USE_FONT_8x8
#define USE_FONT_5x7
// #define USE_FONT_8x8
// #define USE_FONT_16x16
#include <Arduino.h>

View File

@@ -4,7 +4,10 @@
#include <LedMatrix.h>
#include <mathematics.h>
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();
}