v.0.0.7 font_16x16

This commit is contained in:
tiijay
2025-11-05 11:42:33 +01:00
parent 2589cc3533
commit b7f5e924e0
9 changed files with 423 additions and 43 deletions

View File

@@ -2,25 +2,28 @@
#include <MyClass.h>
#include <BlinkInternLed.h>
#include <LedMatrix.h>
#include <font_5x7.h>
LedMatrix matrix;
void printCharMatrixSimple(char c)
{
const uint8_t *fontData = getFontChar(c);
const uint16_t *fontData = getFontChar_16x16(c);
const u_int8_t char_width_pixel = 16;
const u_int8_t font_height = fontHeight_16x16();
Serial.print("<");
Serial.print(c);
Serial.println(">");
String mtrx = "";
for (int row = 0; row < 7; row++)
for (int row = 0; row < font_height; row++)
{
uint8_t line = fontData[row];
for (int col = 0; col < 5; col++)
uint16_t line = fontData[row];
matrix.number_to_bitarray_msb(line, 16);
for (int col = 0; col < char_width_pixel; col++)
{
if (line & (1 << (4 - col)))
if (line & (1 << ((char_width_pixel - 1) - col)))
{
mtrx += "";
}
@@ -51,6 +54,22 @@ void playWithBlinkLed()
Serial.println("PinStatus: " + led_status);
}
void playWithMatrix()
{
matrix.setBrightness(255);
matrix.clear();
matrix.show();
// Draw static "HELLO WORLD"
// matrix.drawText(1, 1, "Hello World!", CRGB::Red);
// matrix.drawText(1, 9, "<°|`¶>", CRGB::Yellow);
// matrix.drawText(1, 17, "Bottom", CRGB::Yellow);
// matrix.drawText(1, 25, "ABCDEFGHIJ.", CRGB::Yellow);
matrix.drawText(1, 33, "A", CRGB::Yellow);
matrix.show();
}
void setup()
{
// Initialize Serial for debug output
@@ -61,20 +80,9 @@ void setup()
{
delay(10);
}
matrix.setBrightness(255);
matrix.clear();
matrix.show();
// Draw static "HELLO WORLD"
matrix.drawText(1, 1, "Hello World!", CRGB::Red);
matrix.drawText(1, 9, "<°|`¶>", CRGB::Yellow);
matrix.drawText(1, 17, "Bottom", CRGB::Yellow);
matrix.drawText(1, 25, "ABCDEFGHIJ.", CRGB::Yellow);
matrix.drawText(1, 33, "Moin u stupid", CRGB::Yellow);
matrix.show();
// printCharMatrixSimple('S');
playWithMatrix();
printCharMatrixSimple('A');
// matrix.number_to_bitarray_msb(0x8F);
// playWithBlinkLed();