From a96f0b5aa51632b224463f2f0310bc7dbe3a79f1 Mon Sep 17 00:00:00 2001 From: gitProtogen Date: Wed, 11 Feb 2026 14:40:28 +0100 Subject: [PATCH] cars --- fonts.h | 4 +-- ledy.ino | 80 ++++++++++++++++++++++++++++++++++++++++++++++++---- prototypes.h | 2 +- 3 files changed, 78 insertions(+), 8 deletions(-) diff --git a/fonts.h b/fonts.h index f35a33a..5dba5bf 100644 --- a/fonts.h +++ b/fonts.h @@ -895,9 +895,9 @@ constexpr bool font7x5[96][7][5] = {false, false, false, false, false}, {true, false, false, false, true}, {true, false, false, false, true}, - {true, true, true, true, true}, + {false, true, true, true, false}, {false, false, false, false, true}, - {true, true, true, true, true} + {false, true, true, true, false} }, // z (ASCII 122) { diff --git a/ledy.ino b/ledy.ino index 6529595..b363dbc 100644 --- a/ledy.ino +++ b/ledy.ino @@ -21,8 +21,8 @@ Cursor cursor; unsigned char global_node_id = 0; bool main_animation_started = false; -unsigned char bottom_text_state = 0; // 0 = "Technik informatyk", 1 = "technik programista" -unsigned char scroll_node_global_id = 0; // tracks current bottom-row node +unsigned char bottom_text_state = 0; +unsigned char scroll_node_global_id = 0; bool scroll_node_active = false; Image saved_images[MAX_IMAGES_SAVED] = { @@ -32,6 +32,70 @@ Image saved_images[MAX_IMAGES_SAVED] = { const RGB animation_data[MAX_ANIMATIONS_COUNT][MAX_ANIMATION_FRAME_COUNT][PANEL_PIXEL_COUNT][DISPLAY_MAX_X + 1] = {}; Animation animations[MAX_ANIMATIONS_COUNT]; +bool vehichles[][][] = +{ + { + {0}, + {0,0,1,1,1,1,1,0}, + {1,1,1,1,1,1,1,1}, + {0,1,0,0,0,0,1,0} + }, + { + {0,0,1,1,0,0,0,0}, + {0,1,1,1,0,0,0,0}, + {1,1,1,1,1,1,1,1}, + {0,1,0,0,0,0,1,0} + }, + { + {0,0,1,1,0,1,1,1}, + {0,1,1,1,1,1,1,1}, + {1,1,1,1,1,1,1,1}, + {0,1,0,0,0,0,1,0} + }, + { + {0,0,0,0,1,1,0,0}, + {0,0,1,1,1,1,1,0}, + {0,1,1,1,1,1,1,1}, + {0,0,1,0,0,0,1,0} + }, + { + {0}, + {0,0,0,1,1,1,1,1}, + {0,0,1,1,1,1,1,1}, + {0,0,0,1,0,0,1,0} + }, + { + {1,1,1,1,1,1,1,1}, + {0,1,0,1,0,1,0,1}, + {0,1,1,1,1,1,1,1}, + {0,0,1,0,0,0,1,0} + }, + { + {0}, + {0,0,1,1,0,0,0,0}, + {1,1,1,1,1,1,1,1}, + {0,1,0,0,0,0,1,0}, + }, + { + {1,1,0,1,1,1,1,1}, + {1,1,0,1,1,1,1,1}, + {1,1,1,1,1,1,1,1}, + {0,1,0,0,0,0,1,0} + }, + { + {0,0,0,1,1,1,1,1}, + {0,0,1,1,1,1,1,1}, + {1,1,1,1,1,1,1,1}, + {0,1,0,0,0,0,1,0} + }, + { + {0}, + {0,1,1,1,0,0,0,1}, + {1,1,1,1,1,1,1,0}, + {0,1,0,0,0,1,0,0} + } +} + short getTextNodeY2(TextNode *node) { @@ -141,7 +205,7 @@ void scrollAllScrollableTexts(bool split_scroll_mode = false) short x1 = text_nodes[i].pos_x; short x2 = getTextNodeX2(&text_nodes[i]); - if (split_scroll_mode || text_nodes[i].pos_y < 7) + if (split_scroll_mode || text_nodes[i].pos_y >= 7) { if (x2 < 0) { @@ -265,7 +329,7 @@ void scrollAllMultiColorTexts(bool split_scroll_mode = false) short x1 = multi_color_text_node[i].pos_x; short x2 = getMultiColorTextNodeX2(&multi_color_text_node[i]); - if (split_scroll_mode || multi_color_text_node[i].pos_y < 7) + if (split_scroll_mode || multi_color_text_node[i].pos_y >= 7) { if (x2 < 0) { @@ -464,7 +528,7 @@ void setup() start_server(); } -void loop() +void handleProgram1() { if (!main_animation_started) { @@ -517,9 +581,15 @@ void loop() bottom_text_state = (bottom_text_state + 1) % 4; } } +} +void loop() +{ pixels.clear(); handle_server(); + + handleProgram1(); + handleDisappearTimers(); handleMultiColorDisappearTimers(); scrollAllScrollableTexts(true); diff --git a/prototypes.h b/prototypes.h index b636909..e4e878b 100644 --- a/prototypes.h +++ b/prototypes.h @@ -34,7 +34,7 @@ short getMultiColorTextNodeX2(MultiColorTextNode *node); void modifyTextNodeByGlobalId(unsigned char global_id, uint32_t new_color, char new_text[TEXT_MAX_LENGTH + 1], unsigned char new_slowness); void modifyMultiColorTextNodeByGlobalId(unsigned char global_id, char new_text[TEXT_MAX_LENGTH + 1], RGBWithIndex new_colors[4], unsigned char new_color_count); bool isNodeExistingByGlobal(unsigned char global_id); - +void handleProgram1(); #endif // PROTOTYPES_H \ No newline at end of file