Skip to content

Commit d6b768d

Browse files
committed
Added raw output to TwitterClient for debugging
1 parent fe4b570 commit d6b768d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

WiFi/examples/WifiTwitterClient/WifiTwitterClient.ino

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Circuit:
1414
* WiFi shield attached to pins 10, 11, 12, 13
1515
16-
created 8 Mar 2012
16+
created 9 Mar 2012
1717
by Tom Igoe
1818
1919
This code is in the public domain.
@@ -71,7 +71,9 @@ void loop()
7171
if (client.available()) {
7272
// read incoming bytes:
7373
char inChar = client.read();
74-
74+
// print the incoming byte (for debugging):
75+
Serial.write(inChar);
76+
7577
// add incoming byte to end of line:
7678
currentLine += inChar;
7779

@@ -117,7 +119,8 @@ void connectToServer() {
117119
Serial.println("making HTTP request...");
118120
// make HTTP GET request to twitter:
119121
client.println("GET /1/statuses/user_timeline.xml?screen_name=arduinoteam HTTP/1.1");
120-
client.println("HOST:api.twitter.com");
122+
client.println("Host:api.twitter.com");
123+
client.println("Connection:close");
121124
client.println();
122125
}
123126
// note the time of this connect attempt:
@@ -132,7 +135,7 @@ void printWifiStatus() {
132135

133136
// print your WiFi shield's IP address:
134137
IPAddress ip = WiFi.localIP();
135-
Serial.print("IP Address: ");
138+
Serial.print("IP Address: ");
136139
Serial.println(ip);
137140

138141
// print the received signal strength:
@@ -142,3 +145,4 @@ void printWifiStatus() {
142145
Serial.println(" dBm");
143146
}
144147

148+

0 commit comments

Comments
 (0)