File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
WiFi/examples/ScanNetworks Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1010
1111 created 13 July 2010
1212 by dlf (Metodo2 srl)
13- modified 12 Mar 2012
13+ modified 2 April 2012
1414 by Tom Igoe
1515 */
1616
1919#include < WiFi.h>
2020
2121void setup () {
22- // initialize serial:
22+ // initialize serial and wait for the port to open :
2323 Serial.begin (9600 );
24+ while (!Serial) ;
2425
2526 // attempt to connect using WEP encryption:
2627 Serial.println (" Initializing Wifi..." );
@@ -41,7 +42,7 @@ void loop() {
4142void printMacAddress () {
4243 // the MAC address of your Wifi shield
4344 byte mac[6 ];
44-
45+
4546 // print your MAC address:
4647 WiFi.macAddress (mac);
4748 Serial.print (" MAC: " );
@@ -66,7 +67,7 @@ void listNetworks() {
6667 // print the list of networks seen:
6768 Serial.print (" number of available networks:" );
6869 Serial.println (numSsid);
69-
70+
7071 // print the network number and name for each network found:
7172 for (int thisNet = 0 ; thisNet<numSsid; thisNet++) {
7273 Serial.print (thisNet);
@@ -81,3 +82,4 @@ void listNetworks() {
8182}
8283
8384
85+
You can’t perform that action at this time.
0 commit comments