我想发布相应的情况,这意味着我需要多次推文。我确实喜欢这个:
void loop() {
checkState();
}
void tweet() {
Serial.println("Connecting to Twitter");
if (twitter.post("input is greater than 5")) {
Serial.print(dataString);
int status = twitter.wait();
if (status == 200) {
Serial.println("Successful");
} else {
Serial.println("Tweet failed.");
Serial.println(status);
}
} else {
Serial.println("Connection to Twitter failed");
}
Serial.println("30 Seconds timeout started");
delay(3000);
}
void checkState() {
// read input and append to the string:
char analogPin = 0;
char input = analogRead(analogPin);
dataString = input;
if (input >= 1023) {
tweet();
delay(2000);
}
}
但它不起作用。你有什么建议吗?