| 
 | 
 
各位師兄你們好 
我是從網站上得知有arduino的 
看見網上發表arduino 能做的事情很多 
便買回家嘗試一下 
我是想用arduino來做WIFI傳輸 
已經買了arduino uno 及 arduino wifi shield v2.0 
以及用下列程式 
程式中的mynetwork & password 我已經更改 
但還是用不到,說int status = WL_IDLE_STATUS; 中有問題 
我卻找不到. 
求各位師兄解答 
#include <SPI.h> 
#include <WiFi.h> 
 
char ssid[] = "myNetwork"; // your network SSID (name)  
char pass[] = "myPassword"; // your network password 
 
int status = WL_IDLE_STATUS; 
IPAddress server(74,125,115,105); // Google 
 
// Initialize the client library 
WiFiClient client; 
 
void setup() { 
Serial.begin(9600); 
Serial.println("Attempting to connect to WPA network..."); 
Serial.print("SSID: "); 
Serial.println(ssid); 
 
status = WiFi.begin(ssid, pass); 
if ( status != WL_CONNECTED) {  
Serial.println("Couldn't get a wifi connection"); 
// don't do anything else: 
while(true); 
}  
else { 
Serial.println("Connected to wifi"); 
Serial.println("\nStarting connection..."); 
// if you get a connection, report back via serial: 
if (client.connect(server, 80)) { 
Serial.println("connected"); 
// Make a HTTP request: 
client.println("GET /search?q=arduino HTTP/1.0"); 
client.println(); 
} 
} 
} 
 
void loop() { 
 
} |   
 
 
 
 |