Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 4:dc0c58eedabb
- Parent:
- 3:2360864c12e2
- Child:
- 5:dad47e5b9586
--- a/main.cpp Tue Nov 29 17:42:52 2016 +0000
+++ b/main.cpp Tue Nov 29 18:18:13 2016 +0000
@@ -73,14 +73,23 @@
// use AnalogIn() unfortunately...
ConfigureADC();
- // Connect to the wifi network. It will basically get stuck here until it
- // connects to the network.
- SetupNetwork(5000);
+ // Check for the wifi module
+ WifiPresent.mode(PullDown);
+ if(WifiPresent == 1){
+ IotStatus.SetFlag(SS_WIFIPRESENT);
+ }
+
+ if(IotStatus.CheckFlag(SS_WIFIPRESENT)){
- // Configure the baud rate of the wifi shield:
- // This will make our wireless transmissions much faster.
- ws.setBaud(115200);
- wait(0.5f);
+ // Connect to the wifi network. It will basically get stuck here until it
+ // connects to the network.
+ SetupNetwork(5000);
+
+ // Configure the baud rate of the wifi shield:
+ // This will make our wireless transmissions much faster.
+ ws.setBaud(115200);
+ wait(0.5f);
+ }
// Configure the PWM module:
ConfigurePWM(Duty_us, PwmPeriod_us);