Hi,
currently I try to use my Arduino Yun Mini with Temboo and Twitter. My written Programm works fine so far. Every 30 seconds Arduino send a Tweet but the message only will be send as long as I have openend the editor ( arduino ) and the serial monitor. If i close all this stuff nothing happens anymore although the Arduino is still pluged in, got internet connection and everything.
For later usage the Arduino just got Power and should tweet messages without any serial monitor or open programm over the wlan module.
Here is some code:
#include <Bridge.h>
#include <Temboo.h>
#include "TembooAccount.h"
char const *tweet1 = "a";
char const *tweet2 = "b";
char const *tweet3 = "c";
int numRuns = 0;
int maxRuns = 3;
int tweetIndex = 0;
void setup() {
Serial.begin(9600);
delay(4000);
while(!Serial);
Bridge.begin();
}
void loop()
{
String tweets[] = { tweet1, tweet2, tweet3, (char const *)NULL };
numRuns++;
if (numRuns <= maxRuns) {
String tweetText(tweets[ tweetIndex ]);
if( tweetText == NULL )
return;
tweetIndex ++;
Serial.println("Running StatusesUpdate - Run #" + String( numRuns ));
TembooChoreo StatusesUpdateChoreo;
StatusesUpdateChoreo.begin();
StatusesUpdateChoreo.setAccountName(TEMBOO_ACCOUNT);
StatusesUpdateChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
StatusesUpdateChoreo.setAppKey(TEMBOO_APP_KEY);
StatusesUpdateChoreo.setProfile("TwitterAccount");
StatusesUpdateChoreo.addInput("StatusUpdate", tweetText);
StatusesUpdateChoreo.setChoreo("/Library/Twitter/Tweets/StatusesUpdate");
StatusesUpdateChoreo.run();
while(StatusesUpdateChoreo.available()) {
char c = StatusesUpdateChoreo.read();
Serial.print(c);
}
StatusesUpdateChoreo.close();
}
Serial.println("Warte auf naechsten Tweet..");
delay(30000);
}
Thank you very much!