wow images
This commit is contained in:
+10
-1
@@ -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, []() {
|
||||
|
||||
Reference in New Issue
Block a user