Button That Tweets
Arduino Code
const int buttonPin = 7;
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
Serial.begin(9600); // initialize serial communications
}
void loop(){
buttonState = digitalRead (buttonPin);
Serial.print (buttonState);
delay (10); // wait some number of milliseconds
}
Processing Code
import com.temboo.core.*;
import com.temboo.Library.Twitter.Tweets.*;
import processing.serial.*;
Serial myPort; // Create object from Serial class
// Create a session using your Temboo account application details
TembooSession session = new TembooSession("boril", "myFirstApp", "mljV10Z8EpQhRIpLb9Zfg46EIw5wbfDT");
void setup() {
String portName = Serial.list()[2];
myPort = new Serial(this, portName, 9600);
runStatusesUpdateChoreo();
}
void runStatusesUpdateChoreo() {
// Create the Choreo object using your Temboo session
StatusesUpdate statusesUpdateChoreo = new StatusesUpdate(session);
// Set credential to use for execution
statusesUpdateChoreo.setCredential("Homework12");
// Set inputs
statusesUpdateChoreo.setAccessToken("2878889817-A1lJYK6T8V0i50Vp6KVDdl9JnduZMEHOp3ELC6S");
statusesUpdateChoreo.setAccessTokenSecret("ZsxrnXixOUcmAHKH3SZKg7zrdncsoonYoXnnLty1yIHNM");
statusesUpdateChoreo.setStatusUpdate("TESTING!!!!");
// Execute Choreo
StatusesUpdateResultSet statusesUpdateResults = statusesUpdateChoreo.run();
}