Added check in case of shield not present

This commit is contained in:
Mimmo La Fauci 2012-05-26 12:06:14 +02:00
parent a1fa79aa24
commit 910111abc6
1 changed files with 6 additions and 1 deletions

View File

@ -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:");