idk
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#define DISPLAY_MAX_Y PANEL_PIXEL_COUNT - 1
|
#define DISPLAY_MAX_Y PANEL_PIXEL_COUNT - 1
|
||||||
|
|
||||||
#define TEXT_MAX_LENGTH 64
|
#define TEXT_MAX_LENGTH 64
|
||||||
#define MAX_MULTI_COLOR_TEXT_NODES_COUNT $
|
#define MAX_MULTI_COLOR_TEXT_NODES_COUNT 4
|
||||||
#define MAX_TEXT_NODES_COUNT 4
|
#define MAX_TEXT_NODES_COUNT 4
|
||||||
#define MAX_IMAGES_SAVED 2
|
#define MAX_IMAGES_SAVED 2
|
||||||
#define MAX_ANIMATION_FRAME_COUNT 12
|
#define MAX_ANIMATION_FRAME_COUNT 12
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ bool main_animation_started = false;
|
|||||||
unsigned char bottom_text_state = 0; // 0 = "Technik informatyk", 1 = "technik programista"
|
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 scroll_node_global_id = 0; // tracks current bottom-row node
|
||||||
bool scroll_node_active = false;
|
bool scroll_node_active = false;
|
||||||
unsigned long main_animation_start_time = 0;
|
|
||||||
bool example_animation_triggered = false;
|
|
||||||
|
|
||||||
Image saved_images[MAX_IMAGES_SAVED] = {
|
Image saved_images[MAX_IMAGES_SAVED] = {
|
||||||
{},{}
|
{},{}
|
||||||
@@ -399,30 +397,6 @@ void stopAnimation(unsigned char index)
|
|||||||
animations[index].is_playing = false;
|
animations[index].is_playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayExampleSlideAnimation()
|
|
||||||
{
|
|
||||||
if (!animations[0].is_playing) return;
|
|
||||||
|
|
||||||
short offset_x = (DISPLAY_MAX_X + 1) - (short)animations[0].current_frame * 2;
|
|
||||||
|
|
||||||
for (unsigned char y = 0; y < PANEL_PIXEL_COUNT; y++)
|
|
||||||
{
|
|
||||||
for (unsigned char bx = 0; bx < PANEL_PIXEL_COUNT; bx++)
|
|
||||||
{
|
|
||||||
short px = offset_x + bx;
|
|
||||||
if (px < 0 || px > DISPLAY_MAX_X) continue;
|
|
||||||
|
|
||||||
unsigned char r, g, b;
|
|
||||||
if (y < 4) { r = 50; g = 0; b = 0; }
|
|
||||||
else if (y < 8) { r = 0; g = 50; b = 0; }
|
|
||||||
else if (y < 12) { r = 0; g = 0; b = 50; }
|
|
||||||
else { r = 50; g = 25; b = 0; }
|
|
||||||
|
|
||||||
setPixel(px, y, pixels.Color(r, g, b));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void handleDisappearTimers()
|
void handleDisappearTimers()
|
||||||
{
|
{
|
||||||
for (unsigned char i = 0; i < MAX_TEXT_NODES_COUNT; i++)
|
for (unsigned char i = 0; i < MAX_TEXT_NODES_COUNT; i++)
|
||||||
@@ -497,7 +471,6 @@ void loop()
|
|||||||
if (!isNodeExistingByGlobal(0) && !isNodeExistingByGlobal(1))
|
if (!isNodeExistingByGlobal(0) && !isNodeExistingByGlobal(1))
|
||||||
{
|
{
|
||||||
main_animation_started = true;
|
main_animation_started = true;
|
||||||
main_animation_start_time = millis();
|
|
||||||
|
|
||||||
// Top row: "Witamy w PTI" — slow scroll, repeating, white + blue PTI
|
// Top row: "Witamy w PTI" — slow scroll, repeating, white + blue PTI
|
||||||
addNewMultiColor("Witamy w PTI",
|
addNewMultiColor("Witamy w PTI",
|
||||||
@@ -516,13 +489,13 @@ void loop()
|
|||||||
if (bottom_text_state == 0)
|
if (bottom_text_state == 0)
|
||||||
{
|
{
|
||||||
node = addNewTextNode("Technik informatyk + ai, robotyka",
|
node = addNewTextNode("Technik informatyk + ai, robotyka",
|
||||||
pixels.Color(0, 0, 50), // blue (dimmed)
|
pixels.Color(0, 0, 50)
|
||||||
false, DISPLAY_MAX_X, 9, 1, true, true, -1, false);
|
false, DISPLAY_MAX_X, 9, 1, true, true, -1, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
node = addNewTextNode("technik programista",
|
node = addNewTextNode("technik programista",
|
||||||
pixels.Color(50, 40, 0), // gold (dimmed)
|
pixels.Color(50, 40, 0),
|
||||||
false, DISPLAY_MAX_X, 9, 1, true, true, -1, false);
|
false, DISPLAY_MAX_X, 9, 1, true, true, -1, false);
|
||||||
}
|
}
|
||||||
if (node != nullptr)
|
if (node != nullptr)
|
||||||
@@ -533,20 +506,11 @@ void loop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (main_animation_started && !example_animation_triggered && millis() - main_animation_start_time > 15000)
|
|
||||||
{
|
|
||||||
example_animation_triggered = true;
|
|
||||||
animations[0].frame_count = 32;
|
|
||||||
playAnimation(0, 3, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
pixels.clear();
|
pixels.clear();
|
||||||
handle_server();
|
handle_server();
|
||||||
handleDisappearTimers();
|
handleDisappearTimers();
|
||||||
handleMultiColorDisappearTimers();
|
handleMultiColorDisappearTimers();
|
||||||
scrollAllScrollableTexts(true);
|
scrollAllScrollableTexts(true);
|
||||||
scrollAllMultiColorTexts(true);
|
scrollAllMultiColorTexts(true);
|
||||||
tickAnimations();
|
|
||||||
displayExampleSlideAnimation();
|
|
||||||
pixels.show();
|
pixels.show();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user