mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Adjusted interval bug in TwitterClient
This commit is contained in:
@ -17,7 +17,6 @@
|
|||||||
* Ethernet shield attached to pins 10, 11, 12, 13
|
* Ethernet shield attached to pins 10, 11, 12, 13
|
||||||
|
|
||||||
created 21 May 2011
|
created 21 May 2011
|
||||||
updates 2 Mar 2012
|
|
||||||
by Tom Igoe
|
by Tom Igoe
|
||||||
|
|
||||||
This code is in the public domain.
|
This code is in the public domain.
|
||||||
@ -30,7 +29,7 @@
|
|||||||
// Enter a MAC address and IP address for your controller below.
|
// Enter a MAC address and IP address for your controller below.
|
||||||
// The IP address will be dependent on your local network:
|
// The IP address will be dependent on your local network:
|
||||||
byte mac[] = {
|
byte mac[] = {
|
||||||
0xDE,0xAD,0xBE,0xEF,0xFE,0xED };
|
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01 };
|
||||||
IPAddress ip(192,168,1,20);
|
IPAddress ip(192,168,1,20);
|
||||||
|
|
||||||
// initialize the library instance:
|
// initialize the library instance:
|
||||||
@ -52,17 +51,17 @@ void setup() {
|
|||||||
currentLine.reserve(256);
|
currentLine.reserve(256);
|
||||||
tweet.reserve(150);
|
tweet.reserve(150);
|
||||||
|
|
||||||
// initialize serial:
|
// initialize serial:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
// attempt a DHCP connection:
|
// attempt a DHCP connection:
|
||||||
Serial.println("Attempting to get an IP address using DHCP:");
|
Serial.println("Attempting to get an IP address using DHCP:");
|
||||||
if (!Ethernet.begin(mac)) {
|
if (!Ethernet.begin(mac)) {
|
||||||
Serial.println("failed to get an IP address using DHCP, trying manually");
|
|
||||||
// if DHCP fails, start with a hard-coded address:
|
// if DHCP fails, start with a hard-coded address:
|
||||||
|
Serial.println("failed to get an IP address using DHCP, trying manually");
|
||||||
Ethernet.begin(mac, ip);
|
Ethernet.begin(mac, ip);
|
||||||
}
|
}
|
||||||
Serial.print("My IP address:");
|
Serial.print("My address:");
|
||||||
Serial.println(ip);
|
Serial.println(Ethernet.localIP());
|
||||||
// connect to Twitter:
|
// connect to Twitter:
|
||||||
connectToServer();
|
connectToServer();
|
||||||
}
|
}
|
||||||
@ -127,3 +126,4 @@ void connectToServer() {
|
|||||||
// note the time of this connect attempt:
|
// note the time of this connect attempt:
|
||||||
lastAttemptTime = millis();
|
lastAttemptTime = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user