32 lines
639 B
Arduino
32 lines
639 B
Arduino
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();
|
|
} |