 #include <WiFi.h>
 
 void setup() {
-  // initialize serial:
+  // initialize serial and wait for the port to open:
   Serial.begin(9600);
+  while(!Serial) ;
 
   // attempt to connect using WEP encryption:
   Serial.println("Initializing Wifi...");

 
 created 13 July 2010
 by dlf (Metodo2 srl)
 modified 12 Mar 2012
 by Tom Igoe
 */


  // print the list of networks seen:
  Serial.print("number of available networks:");
  Serial.println(numSsid);

  // print the network number and name for each network found:
  for (int thisNet = 0; thisNet<numSsid; thisNet++) {
    Serial.print(thisNet);
