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
+13 -8
View File
@@ -40,30 +40,35 @@ void handleUpload()
}
// Save the new image to the next slot
if (saved_images_count < 11)
{ // Ensure we don't overflow (max index is 11)
saved_images_count++;
if (saved_images_count >= MAX_IMAGES_SAVED) {
saved_images_count = 0;
}
// Copy new_image data to saved_imaged array
// Copy new_image data to saved_images array
for (int r = 0; r < 16; r++)
{
for (int c = 0; c < 16; c++)
{
saved_imaged[saved_images_count][r][c] = new_image[r][c].color;
uint32_t color = new_image[r][c].color;
RGB rgb = {(unsigned char)((color >> 16) & 0xFF), (unsigned char)((color >> 8) & 0xFF), (unsigned char)(color & 0xFF)};
saved_images[saved_images_count].pixels[r][c] = rgb;
}
}
saved_images[saved_images_count].width = 16;
saved_images[saved_images_count].height = 16;
pixels.clear();
drawImageFromSaved(0, 0, saved_images_count);
drawImageFromMemoryByIndex(saved_images_count, 0, 0);
pixels.show();
server.send(200, "text/plain", "OK");
saved_images_count++;
}
void handleShowSaved()
{
pixels.clear();
drawImageFromSaved(0, 0, 0);
drawImageFromMemoryByIndex(0, 0, 0);
pixels.show();
server.send(200, "text/plain", "OK");
}