mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-08 11:22:40 +03:00
edited some ethernet ad wifi examples
This commit is contained in:
@@ -132,8 +132,8 @@ void connectToServer() {
|
||||
Serial.println("making HTTP request...");
|
||||
// make HTTP GET request to twitter:
|
||||
client.println("GET /1/statuses/user_timeline.xml?screen_name=arduino HTTP/1.1");
|
||||
client.println("Host:api.twitter.com");
|
||||
client.println("Connection:close");
|
||||
client.println("Host: api.twitter.com");
|
||||
client.println("Connection: close");
|
||||
client.println();
|
||||
}
|
||||
// note the time of this connect attempt:
|
@@ -31,8 +31,8 @@ int keyIndex = 0; // your network key Index number (needed only for W
|
||||
int status = WL_IDLE_STATUS;
|
||||
// if you don't want to use DNS (and reduce your sketch size)
|
||||
// use the numeric IP instead of the name for the server:
|
||||
IPAddress server(173,194,73,105); // numeric IP for Google (no DNS)
|
||||
//char server[] = "www.google.com"; // name address for Google (using DNS)
|
||||
//IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
|
||||
char server[] = "www.google.com"; // name address for Google (using DNS)
|
||||
|
||||
// Initialize the Ethernet client library
|
||||
// with the IP address and port of the server
|
||||
@@ -54,7 +54,7 @@ void setup() {
|
||||
}
|
||||
|
||||
// attempt to connect to Wifi network:
|
||||
while ( status != WL_CONNECTED) {
|
||||
while (status != WL_CONNECTED) {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
|
||||
@@ -72,7 +72,7 @@ void setup() {
|
||||
Serial.println("connected to server");
|
||||
// Make a HTTP request:
|
||||
client.println("GET /search?q=arduino HTTP/1.1");
|
||||
client.println("Host:www.google.com");
|
||||
client.println("Host: www.google.com");
|
||||
client.println("Connection: close");
|
||||
client.println();
|
||||
}
|
Reference in New Issue
Block a user