last leds flahses wierdly

This commit is contained in:
2026-02-04 09:41:32 +01:00
parent 0903121e61
commit 5b82e5a41e
5 changed files with 101 additions and 28 deletions
+58 -5
View File
@@ -17,6 +17,50 @@ TextNode text_nodes[MAX_TEXT_NODES_COUNT];
Cursor cursor;
short ever_created_text_nodes = 0;
Image saved_images[MAX_IMAGES_SAVED] = {
{
{
// Row 0
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,255,0}, {255,255,0}, {255,255,0}, {255,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,0,255}, {255,0,255}, {255,0,255}, {255,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 1
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,255,0}, {255,255,0}, {255,255,0}, {255,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,0,255}, {255,0,255}, {255,0,255}, {255,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 2
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,255,0}, {255,255,0}, {255,255,0}, {255,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,0,255}, {255,0,255}, {255,0,255}, {255,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 3
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,255,0}, {255,255,0}, {255,255,0}, {255,255,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {255,0,255}, {255,0,255}, {255,0,255}, {255,0,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,255,255}, {0,255,255}, {0,255,255}, {0,255,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 4
{{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 5
{{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 6
{{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 7
{{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
// Row 8
{{255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}},
// Row 9
{{255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}},
// Row 10
{{255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}},
// Row 11
{{255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}, {255,255,255}},
// Row 12
{{128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}},
// Row 13
{{128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}},
// Row 14
{{128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}},
// Row 15
{{128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}, {128,128,128}}
},
48, // width
16 // height
},
{}
};
short getTextNodeY2(TextNode *node)
{
return node->pos_y + node->characterSize.height - 1;
@@ -100,7 +144,7 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false)
}
else
{
if (x1 > PANEL_MAX_X)
if (x1 > DISPLAY_MAX_X)
{
text_nodes[i].is_deleted = true;
continue;
@@ -125,6 +169,18 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false)
}
}
void drawImageFromMemoryByIndex(unsigned char image_index, short pos_x, short pos_y)
{
Image* img = &saved_images[image_index];
for (unsigned char y = 0; y < img->height; y++)
{
for (unsigned char x = 0; x < img->width; x++)
{
setPixel(x + pos_x, y + pos_y, pixels.Color(img->pixels[y][x].r, img->pixels[y][x].g, img->pixels[y][x].b));
}
}
}
void setup()
{
Serial.begin(115200);
@@ -146,10 +202,7 @@ void loop()
handle_server();
if (text_nodes[0].is_deleted && text_nodes[2].is_deleted)
{
cursor.x = PANEL_MAX_X + 1;
addNewTextNode("color", 0xFF121212, true);
addNewTextNode("ful ", 0xFF000036, true);
addNewTextNode("test", 0xFF121212, true);
drawImageFromMemoryByIndex(0,0,0);
}
scrollAllScrollableTexts();
pixels.show();