wow images

This commit is contained in:
2026-02-05 11:13:11 +01:00
parent 7136ae7385
commit 84a047f67b
4 changed files with 31 additions and 6 deletions
+10 -1
View File
@@ -7,6 +7,7 @@
const char* ssid = "PPIA";
const char* password = "pawelpdaldonejta";
unsigned char brightness = 100;
WebServer server(80);
@@ -16,6 +17,13 @@ size_t fileContent_len = 0;
String upload_error_message = "";
void handleBrightness() {
if (server.hasArg("value")) {
brightness = server.arg("value").toInt();
}
server.send(200, "text/plain", "OK");
}
void handleRoot()
{
server.send(200, "text/html", index_html);
@@ -91,7 +99,7 @@ void handleBmpUpload() {
void handleShowSaved()
{
pixels.clear();
drawImageFromMemoryByIndex(0, 0, 0, 100);
drawImageFromMemoryByIndex(0, 0, 0, brightness);
pixels.show();
server.send(200, "text/plain", "OK");
}
@@ -108,6 +116,7 @@ void start_server()
Serial.println(WiFi.localIP());
server.on("/", handleRoot);
server.on("/brightness", HTTP_POST, handleBrightness);
server.on("/show-saved", handleShowSaved);
server.on("/upload-page", HTTP_GET, handleUploadPage);
server.on("/upload-bmp", HTTP_POST, []() {