13
13
Circuit:
14
14
* WiFi shield attached to pins 10, 11, 12, 13
15
15
16
- created 13 Mar 2012
16
+ created 15 Mar 2012
17
17
by Tom Igoe
18
18
19
19
This code is in the public domain.
22
22
#include < SPI.h>
23
23
#include < WiFi.h>
24
24
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)
27
27
28
28
int keyIndex = 0 ; // your network key Index number (needed only for WEP)
29
29
int status = WL_IDLE_STATUS; // status of the wifi connection
@@ -35,8 +35,8 @@ const unsigned long requestInterval = 30*1000; // delay between requests; 30
35
35
36
36
// if you don't want to use DNS (and reduce your sketch size)
37
37
// 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
40
40
41
41
boolean requested; // whether you've made a request since connecting
42
42
unsigned long lastAttemptTime = 0 ; // last time you connected to the server, in milliseconds
@@ -52,9 +52,7 @@ void setup() {
52
52
// initialize serial:
53
53
Serial.begin (9600 );
54
54
Serial.println (" Attempting to connect to WPA network..." );
55
- Serial.print (" SSID: " );
56
- Serial.println (ssid);
57
-
55
+
58
56
status = WiFi.begin (ssid, pass);
59
57
if ( status != WL_CONNECTED) {
60
58
Serial.println (" Couldn't get a wifi connection" );
@@ -87,6 +85,8 @@ void loop()
87
85
// tweet is beginning. Clear the tweet string:
88
86
readingTweet = true ;
89
87
tweet = " " ;
88
+ // break out of the loop so this character isn't added to the tweet:
89
+ return ;
90
90
}
91
91
// if you're currently reading the bytes of a tweet,
92
92
// add them to the tweet String:
0 commit comments