Skip to content

Commit 51d7a56

Browse files
author
Tom Igoe
committed
Updated twitter client
1 parent 01a0e7e commit 51d7a56

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

WiFi/examples/WifiTwitterClient/WifiTwitterClient.ino

Lines changed: 8 additions & 8 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 13 Mar 2012
16+
created 15 Mar 2012
1717
by Tom Igoe
1818
1919
This code is in the public domain.
@@ -22,8 +22,8 @@
2222
#include <SPI.h>
2323
#include <WiFi.h>
2424

25-
//char ssid[] = "YourNetwork"; // your network SSID (name)
26-
//char pass[] = "password"; // your network password (use for WPA, or use as key for WEP)
25+
char ssid[] = "YourNetwork"; // your network SSID (name)
26+
char pass[] = "password"; // your network password (use for WPA, or use as key for WEP)
2727

2828
int keyIndex = 0; // your network key Index number (needed only for WEP)
2929
int status = WL_IDLE_STATUS; // status of the wifi connection
@@ -35,8 +35,8 @@ const unsigned long requestInterval = 30*1000; // delay between requests; 30
3535

3636
// if you don't want to use DNS (and reduce your sketch size)
3737
// use the numeric IP instead of the name for the server:
38-
IPAddress server(199,59,149,200); // numeric IP for api.twitter.com
39-
//char server[] = "api.twitter.com"; // name address for twitter API
38+
//IPAddress server(199,59,149,200); // numeric IP for api.twitter.com
39+
char server[] = "api.twitter.com"; // name address for twitter API
4040

4141
boolean requested; // whether you've made a request since connecting
4242
unsigned long lastAttemptTime = 0; // last time you connected to the server, in milliseconds
@@ -52,9 +52,7 @@ void setup() {
5252
// initialize serial:
5353
Serial.begin(9600);
5454
Serial.println("Attempting to connect to WPA network...");
55-
Serial.print("SSID: ");
56-
Serial.println(ssid);
57-
55+
5856
status = WiFi.begin(ssid, pass);
5957
if ( status != WL_CONNECTED) {
6058
Serial.println("Couldn't get a wifi connection");
@@ -87,6 +85,8 @@ void loop()
8785
// tweet is beginning. Clear the tweet string:
8886
readingTweet = true;
8987
tweet = "";
88+
// break out of the loop so this character isn't added to the tweet:
89+
return;
9090
}
9191
// if you're currently reading the bytes of a tweet,
9292
// add them to the tweet String:

0 commit comments

Comments
 (0)