HEYY it works now

So with thanks to Matt, this works now:

Arduino:

const int buttonPin = 2;     // the number of the pushbutton pin

int buttonState = 0;         // variable for reading the pushbutton status

void setup() 
{
//initialize serial communications at a 9600 baud rate
Serial.begin(9600);

// initialize the pushbutton pin as an input:

pinMode(buttonPin, INPUT); 
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
  Serial.print(buttonState);
  
  delay(10);
}

Processing:

////with help from Miranda; thank you muchly I am still bad at serial stuff

import com.temboo.core.*;
import com.temboo.Library.Twitter.Tweets.*;

import processing.serial.*;


Serial myPort;
int currentvalue;
int previousvalue;

// Create a session using your Temboo account application details
TembooSession session = new TembooSession("natroze", "myFirstApp", "05001793540547fab231aefa984084c0");

void setup() {
  String portName =Serial.list()[2];
  myPort =new Serial(this, portName,9600);
}

void draw(){
  previousvalue = currentvalue;
  if (myPort.available() == 0){  //takes the available data
    currentvalue = myPort.read(); //and stores it in the current value
    myPort.clear();
  }
  
  if (currentvalue == 0){
    sendtweet();
    
  }
}

void sendtweet(){
  runStatusesUpdateChoreo();
}
  

void runStatusesUpdateChoreo() {
  // Create the Choreo object using your Temboo session
  StatusesUpdate statusesUpdateChoreo = new StatusesUpdate(session);
  
  //creds
  statusesUpdateChoreo.setCredential("twitterapp");

  // Set inputs
 
  statusesUpdateChoreo.setStatusUpdate("CEASE");


  // Run the Choreo and store the results
  StatusesUpdateResultSet statusesUpdateResults = statusesUpdateChoreo.run();
  

}

Comments are closed.