show image0 button
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
const char* ssid = "PPIA";
|
||||
const char* password = "pawelpdaldonejta";
|
||||
|
||||
WebServer server(80);
|
||||
|
||||
void handleRoot() {
|
||||
server.send(200, "text/html", index_html);
|
||||
}
|
||||
|
||||
void handleShow() {
|
||||
pixels.show();
|
||||
drawImageFromArr(0, 0, 0);
|
||||
server.send(200, "text/plain", "OK");
|
||||
}
|
||||
|
||||
void start_server() {
|
||||
WiFi.begin(ssid, password);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(1000);
|
||||
Serial.println("Connecting to WiFi...");
|
||||
}
|
||||
Serial.println("Connected to WiFi");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
server.on("/", handleRoot);
|
||||
server.on("/show", handleShow);
|
||||
server.begin();
|
||||
}
|
||||
|
||||
void handle_server() {
|
||||
server.handleClient();
|
||||
}
|
||||
Reference in New Issue
Block a user