Skip to content

Commit

Permalink
add longer example
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksville committed Feb 10, 2019
1 parent bc34678 commit 9c8f91d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ If you want to show the user the device is in SmartConfig mode call isProvisione
If you want to reset the provisioning (i.e. 'factory reset') call resetProvisioning(). Wifi settings are stored
in a portion of the 'EEPROM' preferences.

A complete example including support for a factory reset button looks more like this:
```
AutoWifi a;
#ifdef FACTORYRESET_BUTTON
pinMode(FACTORYRESET_BUTTON, INPUT);
if(!digitalRead(FACTORYRESET_BUTTON)) // 1 means not pressed
a.resetProvisioning();
#endif
if(!a.isProvisioned())
lcdMessage("Setup wifi!");
else
lcdMessage(String("join ") + a.getSSID());
a.startWifi();
```

# Reporting issues

Issues and pull requests are happily accepted, please use github.
Expand Down

0 comments on commit 9c8f91d

Please sign in to comment.