mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-22 10:42:10 +10:00
Improve comments for AutoConnectWithStaticIP example
This commit is contained in:
@@ -35,16 +35,21 @@ void setup() {
|
|||||||
//reset settings - for testing
|
//reset settings - for testing
|
||||||
//wifiManager.resetSettings();
|
//wifiManager.resetSettings();
|
||||||
|
|
||||||
//set static ip
|
//set static ip
|
||||||
//the commented bit only works for ESP8266 core 2.1.0 or newer
|
//block1 should be used for ESP8266 core 2.1.0 or newer, otherwise use block2
|
||||||
/*IPAddress _ip,_gw,_sn;
|
|
||||||
_ip.fromString(static_ip);
|
//start-block1
|
||||||
_gw.fromString(static_gw);
|
//IPAddress _ip,_gw,_sn;
|
||||||
_sn.fromString(static_sn);
|
//_ip.fromString(static_ip);
|
||||||
*/
|
//_gw.fromString(static_gw);
|
||||||
|
//_sn.fromString(static_sn);
|
||||||
|
//end-block1
|
||||||
|
|
||||||
|
//start-block2
|
||||||
IPAddress _ip = IPAddress(10, 0, 1, 78);
|
IPAddress _ip = IPAddress(10, 0, 1, 78);
|
||||||
IPAddress _gw = IPAddress(10, 0, 1, 1);
|
IPAddress _gw = IPAddress(10, 0, 1, 1);
|
||||||
IPAddress _sn = IPAddress(255, 255, 255, 0);
|
IPAddress _sn = IPAddress(255, 255, 255, 0);
|
||||||
|
//end-block2
|
||||||
|
|
||||||
wifiManager.setSTAStaticIPConfig(_ip, _gw, _sn);
|
wifiManager.setSTAStaticIPConfig(_ip, _gw, _sn);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user