Pages: [1]   Go Down
Author Topic: [Risolto] [Wifi Shield] WL_IDLE_STATUS was not declared in this scope  (Read 1023 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mi è appena arrivata la Wifi Shield e per fare un primo test (dopo averla inserita nella mia Arduino Uno rev3) ho provato ad eseguire il seguente sketch copiato/incollato da qui: http://arduino.cc/en/Guide/ArduinoWiFiShield#toc1

ma ottengo il seguente errore: "WL_IDLE_STATUS was not declared in this scope".

Ecco il codice in questione (...stampa le reti wifi rilevate):
Code:
#include <SPI.h>
#include <WiFi.h>

void setup() {
   // initialize serial and wait for the port to open:
   Serial.begin(9600);
   while(!Serial) ;

   // attempt to connect using WEP encryption:
   Serial.println("Initializing Wifi...");
   printMacAddress();

   // scan for existing networks:
   Serial.println("Scanning available networks...");
   listNetworks();
}

void loop() {
   delay(10000);
   // scan for existing networks:
   Serial.println("Scanning available networks...");
   listNetworks();
}

void printMacAddress() {
   // the MAC address of your Wifi shield
   byte mac[6];                    

   // print your MAC address:
   WiFi.macAddress(mac);
   Serial.print("MAC: ");
   Serial.print(mac[5],HEX);
   Serial.print(":");
   Serial.print(mac[4],HEX);
   Serial.print(":");
   Serial.print(mac[3],HEX);
   Serial.print(":");
   Serial.print(mac[2],HEX);
   Serial.print(":");
   Serial.print(mac[1],HEX);
   Serial.print(":");
   Serial.println(mac[0],HEX);
}

void listNetworks() {
   // scan for nearby networks:
   Serial.println("** Scan Networks **");
   byte numSsid = WiFi.scanNetworks();

   // 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);
     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));
   }
}

Ho già scaricato la Wifi Shield Library da questo link:
http://arduino.cc/en/uploads/Main/WiFiShield_library.zip

e posizionato la cartella WiFi in .../Arduino/library/

e non riesco a capire come mai ottengo quell'errore, chi sarebbe così gentile da aiutarmi?
« Last Edit: November 08, 2012, 09:40:51 am by abstract » Logged

IDE 1.0.5 - Arduino Uno R3 - Arduino Wifi Shield - Arduino GSM Shield -  IMU Digital Combo Board 6 DOF ITG3200/ADXL345

Cagliari, Italy
Online Online
Tesla Member
***
Karma: 114
Posts: 7193
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Su IDE 1.0.2 con Win7 compila perfettamente.
Se è la shield ufficiale non c'è bisogno di aggiungere nessuna libreria.

Scarica il nuovo IDE --> http://arduino.cc/en/Main/Software
Logged

Code fast. Code easy. Codebender --> http://codebender.cc/?referrer=PaoloP

0
Offline Offline
Edison Member
*
Karma: 24
Posts: 2315
Have you mooed today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao,
anche su ide 1.0.1 compila senza problemi, as is
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ho scaricato la versione 1.0.2 dell'IDE e ora compila!  smiley-eek

Grazie mille ragazzi per le risposte, veloci ed efficaci!  smiley
« Last Edit: November 08, 2012, 09:41:05 am by abstract » Logged

IDE 1.0.5 - Arduino Uno R3 - Arduino Wifi Shield - Arduino GSM Shield -  IMU Digital Combo Board 6 DOF ITG3200/ADXL345

Cagliari, Italy
Online Online
Tesla Member
***
Karma: 114
Posts: 7193
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bene, buon WiFi con Arduino.  smiley-mr-green
Logged

Code fast. Code easy. Codebender --> http://codebender.cc/?referrer=PaoloP

Pages: [1]   Go Up
Jump to: