#include <SPI.h> // needed in Arduino 0019 or later
#include <Ethernet.h>
#include <Twitter.h>
int val;
void setup() {
pinMode(8, INPUT_PULLUP); //디지털 8번핀에 연결
}
void loop() {
val = digitalRead(8);
if(val == 1);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// If you don't specify the IP address, DHCP is used(only in Arduino 1.0 or later).
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("3414897019-8uQuHUzSLByP33wnMgf78huC4Foxc2QKzpRBHPv");
// Message to post
char msg[] = "(값)";
Ethernet.begin(mac);
// or you can use DHCP for autoomatic IP address configuration.
// Ethernet.begin(mac);
Serial.begin(9600);
Serial.println("connecting ...");
if (twitter.post(msg)) {
// Specify &Serial to output received response to Serial.
// If no output is required, you can just omit the argument, e.g.
// int status = twitter.wait();
int status = twitter.wait(&Serial);
if (status == 200) {
Serial.println("OK.");
} else {
Serial.print("failed : code ");
Serial.println(status);
}
} else {
Serial.println("connection failed.");
}
}
이거 마그네틱 도어 센서로 트위터 올리는 것인데... 계속.. 값이 1 이든 말든 계속 트윗이 올라가고,,
con27 GMT
Server: Google Frontend
Content-Length: 27
Error 503 - Too many accessfailed : code 503
시리얼 모니터에서 이 오류가 반복됩니다.
도와주세요!!
|