hi,
currently try use arduino yun mini temboo , twitter. written programm works fine far. every 30 seconds arduino send tweet message send long have openend editor ( arduino ) , serial monitor. if close stuff nothing happens anymore although arduino still pluged in, got internet connection , everything.
for later usage arduino got power , should tweet messages without serial monitor or open programm on wlan module.
here code:
thank much!
currently try use arduino yun mini temboo , twitter. written programm works fine far. every 30 seconds arduino send tweet message send long have openend editor ( arduino ) , serial monitor. if close stuff nothing happens anymore although arduino still pluged in, got internet connection , everything.
for later usage arduino got power , should tweet messages without serial monitor or open programm on wlan module.
here code:
code: [select]
#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 much!
this line pauses operation of program until serial connection present. added won't miss serial output between time program starts , when have opened serial monitor. if want program run without serial connection should comment line out.code: [select]while(!serial);
Arduino Forum > Using Arduino > Installation & Troubleshooting > Arduino Auto-Start Problem
arduino
Comments
Post a Comment