diff --git a/sound_picture_app/Display_PNG.cpp b/sound_picture_app/Display_PNG.cpp index a3a64b0..7b32eb0 100644 --- a/sound_picture_app/Display_PNG.cpp +++ b/sound_picture_app/Display_PNG.cpp @@ -122,3 +122,38 @@ void Draw_Candle_Flicker() { LCD_addWindow(71, 125, 101, 167, canvas); } + +void Draw_Sunflower_Pattern() { + clearScreen(); + + // Fill the screen with a stylized sunflower: + // Center of screen is x=86, y=160. + uint16_t line[172]; + + for (int y = 0; y < 320; y++) { + for (int x = 0; x < 172; x++) { + int dx = x - 86; + int dy = y - 160; + int dist2 = dx*dx + dy*dy; + + if (dist2 < 30*30) { + // Sunflower center (brown) + line[x] = 0x5140; // dark brown + } else if (dist2 < 65*65 && (abs(dx) < 15 || abs(dy) < 15 || abs(dx-dy) < 12 || abs(dx+dy) < 12)) { + // Golden petals + line[x] = 0xFDA0; // Golden orange/yellow + } else if (dist2 < 70*70 && (abs(dx) < 22 || abs(dy) < 22)) { + // Outer petals highlight + line[x] = 0xFFE0; // Yellow + } else { + // Charcoal background + line[x] = 0x18C3; // Very dark warm gray + } + } + // Swap bytes for ST7789 SPI big-endian transfer + for (int x = 0; x < 172; x++) { + line[x] = __builtin_bswap16(line[x]); + } + LCD_addWindow(0, y, 171, y, line); + } +} diff --git a/sound_picture_app/Display_PNG.h b/sound_picture_app/Display_PNG.h index 6b83bd5..d982948 100644 --- a/sound_picture_app/Display_PNG.h +++ b/sound_picture_app/Display_PNG.h @@ -13,3 +13,4 @@ void Display_Memory_Photo(int memoryIndex); // Standby Remembrance Candle Flicker animation void Draw_Candle_Body(); void Draw_Candle_Flicker(); +void Draw_Sunflower_Pattern(); diff --git a/sound_picture_app/Display_ST7789.cpp b/sound_picture_app/Display_ST7789.cpp index 4e31c23..58ee186 100644 --- a/sound_picture_app/Display_ST7789.cpp +++ b/sound_picture_app/Display_ST7789.cpp @@ -208,15 +208,15 @@ void LCD_addWindow(uint16_t Xstart, uint16_t Ystart, uint16_t Xend, uint16_t Yen void Backlight_Init(void) { pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT); - digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW); // Set backlight to full brightness (LOW for active-low) + digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // Set backlight to full brightness (HIGH for active-high) } void Set_Backlight(uint8_t Light) { pinMode(EXAMPLE_PIN_NUM_BK_LIGHT, OUTPUT); if (Light > 0) { - digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW); // ON (active-low) + digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // ON (active-high) } else { - digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, HIGH); // OFF + digitalWrite(EXAMPLE_PIN_NUM_BK_LIGHT, LOW); // OFF } } diff --git a/sound_picture_app/sound_picture_app.ino b/sound_picture_app/sound_picture_app.ino index ddfb4a8..2ad8b5b 100644 --- a/sound_picture_app/sound_picture_app.ino +++ b/sound_picture_app/sound_picture_app.ino @@ -122,7 +122,7 @@ void setup() { if (g_memoryCount == 0) { printf("No memories found. Add some via the web app.\r\n"); g_standbyActive = true; - Draw_Candle_Body(); + Draw_Sunflower_Pattern(); } else { int favoriteIndex = -1; if (g_favoriteMemoryId >= 0) { @@ -238,7 +238,7 @@ void loop() { if (g_memoryCount == 0) { if (!g_standbyActive) { g_standbyActive = true; - Draw_Candle_Body(); + Draw_Sunflower_Pattern(); } } else if (!g_standbyActive && !isAudioPlaying() && currentState == STATE_IDLE && !g_tributeActive) { if (now - lastInteractionTime > STANDBY_TIMEOUT) { @@ -248,7 +248,7 @@ void loop() { } } - if (g_standbyActive) { + if (g_standbyActive && g_memoryCount > 0) { Draw_Candle_Flicker(); }