Skip to content

Commit 0898503

Browse files
tigoeTom Igoe
authored andcommitted
Adjusted interval bug in TwitterClient
1 parent 3ebb306 commit 0898503

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/TwitterClient/TwitterClient.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
version 0019.
1515
1616
Circuit:
17-
* Ethernet shield attached to pins 10, 11, 12, 13
17+
* Ethernet shield attached to pins 10, 11, 12, 13
1818
1919
created 21 May 2011
20-
updates 2 Mar 2012
2120
by Tom Igoe
2221
2322
This code is in the public domain.
@@ -30,7 +29,7 @@
3029
// Enter a MAC address and IP address for your controller below.
3130
// The IP address will be dependent on your local network:
3231
byte mac[] = {
33-
0xDE,0xAD,0xBE,0xEF,0xFE,0xED };
32+
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01 };
3433
IPAddress ip(192,168,1,20);
3534

3635
// initialize the library instance:
@@ -52,17 +51,17 @@ void setup() {
5251
currentLine.reserve(256);
5352
tweet.reserve(150);
5453

55-
// initialize serial:
54+
// initialize serial:
5655
Serial.begin(9600);
5756
// attempt a DHCP connection:
5857
Serial.println("Attempting to get an IP address using DHCP:");
5958
if (!Ethernet.begin(mac)) {
60-
Serial.println("failed to get an IP address using DHCP, trying manually");
6159
// if DHCP fails, start with a hard-coded address:
60+
Serial.println("failed to get an IP address using DHCP, trying manually");
6261
Ethernet.begin(mac, ip);
6362
}
64-
Serial.print("My IP address:");
65-
Serial.println(ip);
63+
Serial.print("My address:");
64+
Serial.println(Ethernet.localIP());
6665
// connect to Twitter:
6766
connectToServer();
6867
}
@@ -119,11 +118,12 @@ void connectToServer() {
119118
Serial.println("connecting to server...");
120119
if (client.connect(serverName, 80)) {
121120
Serial.println("making HTTP request...");
122-
// make HTTP GET request to twitter:
121+
// make HTTP GET request to twitter:
123122
client.println("GET /1/statuses/user_timeline.xml?screen_name=arduino&count=1 HTTP/1.1");
124123
client.println("HOST: api.twitter.com");
125124
client.println();
126125
}
127126
// note the time of this connect attempt:
128127
lastAttemptTime = millis();
129128
}
129+

0 commit comments

Comments
 (0)