Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////
- // Generated with a lot of love//
- // with TUNIOT FOR ESP8266 //
- // Website: Easycoding.tn //
- /////////////////////////////////
- #include <ESP8266WiFi.h>
- IPAddress staticIP753_20(192,168,1,2);
- IPAddress gateway753_20(192,168,1,1);
- IPAddress subnet753_20(255,255,255,0);
- WiFiServer server(80);
- void setup()
- {
- Serial.begin(115200);
- WiFi.disconnect();
- delay(3000);
- Serial.println("START");
- WiFi.begin("xxxxxx","xxxxxxx");
- while ((!(WiFi.status() == WL_CONNECTED))){
- delay(300);
- Serial.print("..");
- }
- Serial.println("Connected");
- WiFi.config(staticIP753_20, gateway753_20, subnet753_20);
- Serial.println("Your IP is");
- Serial.println((WiFi.localIP()));
- server.begin();
- }
- void loop()
- {
- WiFiClient client = server.available();
- if (!client) { return; }
- while(!client.available()){ delay(1); }
- client.flush();
- client.println("HTTP/1.1 200 OK");
- client.println("Content-Type: text/html");
- client.println("");
- client.println("<!DOCTYPE HTML>");
- client.println("<html>");
- client.println(analogRead(A0));
- client.println("</html>");
- client.stop();
- delay(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement