From 910111abc6b27b2dbf2d9ef22d1ff0bf3c00238f Mon Sep 17 00:00:00 2001 From: Mimmo La Fauci Date: Sat, 26 May 2012 12:06:14 +0200 Subject: [PATCH] Added check in case of shield not present --- WiFi/examples/ScanNetworks/ScanNetworks.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WiFi/examples/ScanNetworks/ScanNetworks.ino b/WiFi/examples/ScanNetworks/ScanNetworks.ino index 2c10fed33..7ff9410e3 100644 --- a/WiFi/examples/ScanNetworks/ScanNetworks.ino +++ b/WiFi/examples/ScanNetworks/ScanNetworks.ino @@ -61,7 +61,12 @@ void printMacAddress() { void listNetworks() { // scan for nearby networks: Serial.println("** Scan Networks **"); - byte numSsid = WiFi.scanNetworks(); + int numSsid = WiFi.scanNetworks(); + if (numSsid == -1) + { + Serial.println("Couldn't get a wifi connection"); + while(true); + } // print the list of networks seen: Serial.print("number of available networks:");