Skip to content

Commit f3ff8ea

Browse files
committed
Minor changes
1 parent eb3379d commit f3ff8ea

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

examples/adafruitio_28_wifimanager-custom-aio-parameters/adafruitio_28_wifimanager-custom-aio-parameters.ino

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
* to the network instead of defining the WiFI SSID and password
66
* explicitly in the code.
77
*
8-
* In addition, the examples allows you to enter your Adafruit IO username and key
8+
* In addition, this example allows you to enter your Adafruit IO username and key
99
* as customer parameters in WiFiManager so that they do not need to be coded into
1010
* the sketch.
11+
*
12+
* This is useful if you want to create projects and share them with others that
13+
* may use them on a different WiFi network and use a different Adafruit IO account
14+
* for IOT integrations such as collecting sensor data or voice command integration via
15+
* IFFT.
1116
*
1217
* To use this example, setup a feed called "myfeed". When the ESP8266 or ESP32
13-
* microcontroller starts, join the "WiFi Setup" SSID and you should be presetned
18+
* microcontroller starts, join the "WiFi Setup" SSID and you should be presented
1419
* with the config portal. If the config portal does not automatically start you
1520
* can browse to http://192.168.4.1 to access it
1621
*
@@ -41,6 +46,8 @@ char IO_KEY[64] = "";
4146
static uint8_t objStorage[sizeof(AdafruitIO_WiFi)]; // RAM for the object
4247
AdafruitIO_WiFi *io; // a pointer to the object, once it's constructed
4348

49+
// create WiFiManager object and define our custom parameters
50+
4451
WiFiManager wifiManager;
4552
WiFiManagerParameter custom_IO_USERNAME("iouser", "Adafruit IO Username", IO_USERNAME, 60);
4653
WiFiManagerParameter custom_IO_KEY("iokey", "Adafruit IO Key", IO_KEY, 60);
@@ -131,10 +138,9 @@ void setup()
131138
Serial.begin(115200); // Initialize serial port for debugging.
132139
delay(500);
133140

134-
readParamsFromFS(); // get parameters fro file system
141+
readParamsFromFS(); // get parameters fro file system
135142

136143
// wifiManager.resetSettings(); //uncomment to reset the WiFi settings
137-
// LittleFS.format(); // uncomment to format file system
138144

139145
wifiManager.setClass("invert"); // enable "dark mode" for the config portal
140146
wifiManager.setConfigPortalTimeout(120); // auto close configportal after n seconds
@@ -143,8 +149,8 @@ void setup()
143149
wifiManager.addParameter(&custom_IO_USERNAME); // set custom paraeter for IO username
144150
wifiManager.addParameter(&custom_IO_KEY); // set custom parameter for IO key
145151

146-
custom_IO_KEY.setValue(IO_KEY, 64); // set custom parameter value
147-
custom_IO_USERNAME.setValue(IO_USERNAME, 64); // set custom parameter value
152+
custom_IO_KEY.setValue(IO_KEY, 64); // set custom parameter value
153+
custom_IO_USERNAME.setValue(IO_USERNAME, 64); // set custom parameter value
148154

149155
wifiManager.setSaveConfigCallback(saveConfigCallback); // set config save notify callback
150156

0 commit comments

Comments
 (0)