File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1- #include < Arduino.h>
21#include < ESP8266WiFi.h>
32#include < WiFiClient.h>
43#include < ESP8266WebServer.h>
54#include < ESP8266mDNS.h>
65
7- const char * ssid = " ******" ;
8- const char * password = " ******" ;
9- MDNSResponder mdns;
6+ const char * ssid = " ........" ;
7+ const char * password = " ........" ;
108
119ESP8266WebServer server (80 );
1210
@@ -39,6 +37,7 @@ void setup(void){
3937 pinMode (led, OUTPUT);
4038 digitalWrite (led, 0 );
4139 Serial.begin (115200 );
40+ WiFi.mode (WIFI_STA);
4241 WiFi.begin (ssid, password);
4342 Serial.println (" " );
4443
@@ -53,7 +52,7 @@ void setup(void){
5352 Serial.print (" IP address: " );
5453 Serial.println (WiFi.localIP ());
5554
56- if (mdns .begin (" esp8266" , WiFi. localIP () )) {
55+ if (MDNS .begin (" esp8266" )) {
5756 Serial.println (" MDNS responder started" );
5857 }
5958
@@ -71,4 +70,4 @@ void setup(void){
7170
7271void loop (void ){
7372 server.handleClient ();
74- }
73+ }
Original file line number Diff line number Diff line change 11/*
2- * This sketch demonstrates how to scan WiFi networks.
3- * The API is almost the same as with the WiFi Shield library,
2+ * This sketch demonstrates how to scan WiFi networks.
3+ * The API is almost the same as with the WiFi Shield library,
44 * the most obvious difference being the different file you need to include:
55 */
6- #include < Arduino.h>
76#include " ESP8266WiFi.h"
87
98void setup () {
You can’t perform that action at this time.
0 commit comments