v.0.0.8 mv number_to_bitarray_msb in utils-mathematics

This commit is contained in:
tiijay
2025-11-05 17:23:42 +01:00
parent b7f5e924e0
commit 7bdd67f3c3
6 changed files with 66 additions and 46 deletions

View File

@@ -2,14 +2,15 @@
#include <MyClass.h>
#include <BlinkInternLed.h>
#include <LedMatrix.h>
#include <mathematics.h>
LedMatrix matrix;
void printCharMatrixSimple(char c)
{
const uint16_t *fontData = getFontChar_16x16(c);
const u_int8_t char_width_pixel = 16;
const u_int8_t font_height = fontHeight_16x16();
const auto *fontData = getFontChar_5x7(c);
const u_int8_t char_width_pixel = 5;
const u_int8_t font_height = fontHeight_5x7();
Serial.print("<");
Serial.print(c);
@@ -19,7 +20,6 @@ void printCharMatrixSimple(char c)
for (int row = 0; row < font_height; row++)
{
uint16_t line = fontData[row];
matrix.number_to_bitarray_msb(line, 16);
for (int col = 0; col < char_width_pixel; col++)
{
@@ -62,10 +62,10 @@ void playWithMatrix()
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, 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();
}
@@ -81,9 +81,9 @@ void setup()
delay(10);
}
playWithMatrix();
// playWithMatrix();
printCharMatrixSimple('A');
// matrix.number_to_bitarray_msb(0x8F);
number_to_bitarray_msb(0x11FF, 16, true);
// playWithBlinkLed();
}