v.0.1.2 MATRIX_ROWS & MATRIX_COLS
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -4,6 +4,7 @@
|
|||||||
"font_5x7,cpp": "cpp",
|
"font_5x7,cpp": "cpp",
|
||||||
"map": "cpp",
|
"map": "cpp",
|
||||||
"format": "cpp",
|
"format": "cpp",
|
||||||
"system_error": "cpp"
|
"system_error": "cpp",
|
||||||
|
"random": "cpp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
// #define USE_FONT_5x7
|
#define USE_FONT_5x7
|
||||||
#define USE_FONT_8x8
|
// #define USE_FONT_8x8
|
||||||
// #define USE_FONT_16x16
|
// #define USE_FONT_16x16
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|||||||
@@ -4,7 +4,10 @@
|
|||||||
#include <LedMatrix.h>
|
#include <LedMatrix.h>
|
||||||
#include <mathematics.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
|
#ifdef USE_FONT_5x7
|
||||||
const uint8_t _fontWidthPixel = 5;
|
const uint8_t _fontWidthPixel = 5;
|
||||||
@@ -27,7 +30,6 @@ void printCharMatrixSimple(char c)
|
|||||||
const u_int8_t font_height = 16;
|
const u_int8_t font_height = 16;
|
||||||
#endif
|
#endif
|
||||||
const auto *fontData = fontData_.data();
|
const auto *fontData = fontData_.data();
|
||||||
|
|
||||||
Serial.print("<");
|
Serial.print("<");
|
||||||
Serial.print(c);
|
Serial.print(c);
|
||||||
Serial.println(">");
|
Serial.println(">");
|
||||||
@@ -52,7 +54,7 @@ void printCharMatrixSimple(char c)
|
|||||||
}
|
}
|
||||||
Serial.println(mtrx);
|
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();
|
matrix.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user