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 10
10
11
11
created 13 July 2010
12
12
by dlf (Metodo2 srl)
13
- modified 12 Mar 2012
13
+ modified 2 April 2012
14
14
by Tom Igoe
15
15
*/
16
16
19
19
#include < WiFi.h>
20
20
21
21
void setup () {
22
- // initialize serial:
22
+ // initialize serial and wait for the port to open :
23
23
Serial.begin (9600 );
24
+ while (!Serial) ;
24
25
25
26
// attempt to connect using WEP encryption:
26
27
Serial.println (" Initializing Wifi..." );
@@ -41,7 +42,7 @@ void loop() {
41
42
void printMacAddress () {
42
43
// the MAC address of your Wifi shield
43
44
byte mac[6 ];
44
-
45
+
45
46
// print your MAC address:
46
47
WiFi.macAddress (mac);
47
48
Serial.print (" MAC: " );
@@ -66,7 +67,7 @@ void listNetworks() {
66
67
// print the list of networks seen:
67
68
Serial.print (" number of available networks:" );
68
69
Serial.println (numSsid);
69
-
70
+
70
71
// print the network number and name for each network found:
71
72
for (int thisNet = 0 ; thisNet<numSsid; thisNet++) {
72
73
Serial.print (thisNet);
@@ -81,3 +82,4 @@ void listNetworks() {
81
82
}
82
83
83
84
85
+
You can’t perform that action at this time.
0 commit comments