Page 1
The WiFi Library is included with the most recent version of the Arduino IDE. The firmware for the WiFi shield has changed in Arduino IDE 1.0.4. It is strongly recommended to install this update per these instructions WiFI library is similar to the Ethernet library and many of the function calls are the same.
Page 2
Digital pin 7 is used as a handshake pin between the WiFi shield and the Arduino, and should not be used. Using the Shield With Older Boards If you are using the WiFi shield with an Arduino earlier than the Uno rev3, you need to make the connection below for the board to work.
Page 3
board to which it is attached. If you are using the shield with an older board, you need to connect the shield's IOREF pin to 3.3V. You can do this either with a jumper wire connecting IOREF to 3.3V as shown in the photo below, or by soldering the IOREF jumper on the bottom of the shield, shown below.
There is an onboard micro-USB connector. This is not for programming an attached Arduino, it is for updating the Atmega 32UC3 using the Atmel DFU protocol. The programming jumper adjacent to the power bus and analog inputs should be left unconnected for typical use. It is only used for DFU programming mode.
Page 6
The sketch below is a good one to run the first time you use the board in a new area. This sketch will not connect to a network, but it will show you what networks the shield can view. Your WiFi shield will probably not see as many networks as a computer with a larger WiFi antenna.
Page 7
Serial.print(") "); Serial.print(WiFi.SSID(thisNet)); Serial.print("\tSignal: "); Serial.print(WiFi.RSSI(thisNet)); Serial.print(" dBm"); Serial.print("\tEncryption: "); Serial.println(WiFi.encryptionType(thisNet)); Open network example The sketch below shows you how to initiate a connection with an open network named "yourNetwork". #include <WiFi.h> char ssid[] = "yourNetwork"; // the name of your network status = WL_IDLE_STATUS;...
Page 8
// if you're not connected, stop here: ( status != WL_CONNECTED) { Serial.println("Couldn't get a wifi connection"); while(true); // if you are connected, print out info about the connection: else Serial.println("Connected to network"); void loop() { // do nothing WEP Network example Your router will most likely have a settings dialog similar to the one below for generating the WEP key based on an ASCII passphrase: If you do not have access to your router's administrative tools, consult your network administrator.
Page 9
The SS for the SD card is pin 4. Arduino communicates with the shield using the SPI bus. This is on digital pins 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the Mega. On both boards, pin 10 is used as SS. On the Mega, the hardware SS pin, 53, is not used, but it must be kept as an output or the SPI interface won't work.
Page 10
The text of the Arduino getting started guide is licensed under a Creative Commons Attribution- ShareAlike 3.0 License. Code samples in the guide are released into the public domain.
Need help?
Do you have a question about the WiFI Shield and is the answer not in the manual?
Questions and answers