Skip to content

Commit cb4030a

Browse files
committed
Sync Arduino examples with Core 2.4.0
1 parent 3613a12 commit cb4030a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

examples/arduino-webserver/src/HelloServer.ino

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
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

119
ESP8266WebServer 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

7271
void loop(void){
7372
server.handleClient();
74-
}
73+
}

examples/arduino-wifiscan/src/WiFiScan.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
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

98
void setup() {

0 commit comments

Comments
 (0)