I have WEMOS D1 board based on ESP8266 and I want to blink led over the wifi
I haven't written this code. I did the copy & paste to check result
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
// Fill in your WiFi router SSID and password
const char* ssid = "JAlTYRt";
const char* password = "hgjg321";
MDNSResponder mdns;
ESP8266WebServer server(80);
const char INDEX_HTML[] =
"<!DOCTYPE HTML>"
"<html>"
"<head>"
"<meta name = \"viewport\" content = \"width = device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable=0\">"
"<title>ESP8266 Web Form Demo</title>"
"<style>"
"\"body { background-color: #808080; font-family: Arial, Helvetica, Sans-Serif; Color: #000000; }\""
"</style>"
"</head>"
"<body>"
"<h1>ESP8266 Web Form Demo</h1>"
"<FORM action=\"/\" method=\"post\">"
"<P>"
"LED
"
"<INPUT type=\"radio\" name=\"LED\" value=\"0\">On
"
"<INPUT type=\"radio\" name=\"LED\" value=\"1\">Off
"
"<INPUT type=\"submit\" value=\"Send\"> <INPUT type=\"reset\">"
"</P>"
"</FORM>"
"</body>"
"</html>";
// GPIO#0 is for Adafruit ESP8266 HUZZAH board. Your board LED might be on 13.
const int LEDPIN = D0;
void handleRoot()
{
if (server.hasArg("LED")) {
handleSubmit();
}
else {
server.send(200, "text/html", INDEX_HTML);
}
}
void returnFail(String msg)
{
server.sendHeader("Connection", "close");
server.sendHeader("Access-Control-Allow-Origin", "*");
server.send(500, "text/plain", msg + "\r\n");
}
void handleSubmit()
{
String LEDvalue;
if (!server.hasArg("LED")) return returnFail("BAD ARGS");
LEDvalue = server.arg("LED");
if (LEDvalue == "1") {
writeLED(true);
Following are errors
Arduino: 1.8.5 (Windows 10), Board: "WeMos D1 R1, 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
In file included from e:\4. internet of things\2. esp8266\arduino-1.8.5-windows\arduino-1.8.5\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\algorithm:60:0,
from E:\4. Internet of Things\2. ESP8266\arduino-1.8.5-windows\arduino-1.8.5\portable\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/Arduino.h:255,
from sketch\sketch_oct08.ino.cpp:1:
e:\4. internet of things\2. esp8266\arduino-1.8.5-windows\arduino-1.8.5\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\utility:68:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 R1.This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.