1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

fixed typos, brought back LED to blink

This commit is contained in:
ficeto
2015-05-01 11:51:06 +03:00
parent dbbd047980
commit 978dbebd70
2 changed files with 12 additions and 4 deletions

View File

@ -6,14 +6,18 @@
const char* ssid = "........";
const char* password = "........";
MDNSResponder mdns;
ESP8266WebServer server(80);
const int led = 13;
void handle_root() {
digitalWrite(led, 1);
server.send(200, "text/plain", "hello from esp8266!");
digitalWrite(led, 0);
}
bool handle_not_found(){
digitalWrite(led, 1);
String message = "URI: ";
message += server.uri();
message += "\nMethod: ";
@ -26,11 +30,14 @@ bool handle_not_found(){
}
message += "\nNotFound!";
server.send(404, "text/plain", message);
digitalWrite(led, 0);
return true;
}
void setup(void){
Serial.begin(115200);
pinMode(led, OUTPUT);
digitalWrite(led, 0);
WiFi.begin(ssid, password);
Serial.println("");