We are about to switch to a new forum software. Until then we have removed the registration on this forum.
import ddf.minim.*;
//AudioPlayer player;
//AudioInput input;
Minim minim;
AudioPlayer song;
import com.temboo.core.*;
import com.temboo.Library.Twitter.Tweets.*;
// Create a session using your Temboo account application details
TembooSession session = new TembooSession("", "", "");
PFont font;
String time = "10";
int t;
int interval = 10;
void setup()
{
size(500, 500);
;
minim = new Minim(this);
song = minim.loadFile("alarm.mp3");
//song.play();
font = createFont("Arial", 100);
background(255);
fill(0);
}
void draw()
{
background(255);
t = interval-int(millis()/1000);
time = nf(t , 1);
if(t == 0){
song.play();
noLoop();
// if (keyPressed == false){
// delay(16000);
// runStatusesUpdateChoreo();
}
interval+=10;
}
text(time, width/2, height/2);
}
void keyPressed() {
if (keyPressed == true);
{
songClose();
}
if (keyPressed == false);
{
//else // Run the StatusesUpdate Choreo function
runStatusesUpdateChoreo();
}
}
void songClose() {
song.close();
}
void runStatusesUpdateChoreo() {
// Create the Choreo object using your Temboo session
StatusesUpdate statusesUpdateChoreo = new StatusesUpdate(session);
// Set inputs
statusesUpdateChoreo.setAccessToken("");
statusesUpdateChoreo.setAccessTokenSecret("");
statusesUpdateChoreo.setConsumerSecret("");
statusesUpdateChoreo.setStatusUpdate("");
statusesUpdateChoreo.setConsumerKey("");
// Run the Choreo and store the results
StatusesUpdateResultSet statusesUpdateResults = statusesUpdateChoreo.run();
// Print results
println(statusesUpdateResults.getResponse());
}
I'm having problems running the sketch, I'm new to processing and not sure what it means by mixing "active and "static" modes.
Thanks
Answers
hit ctrl-t in the processing editor and it'll indent the code for you, which makes it much easier to see problems...
mixing modes warning is usually because you have code outside of methods. it's a bit of a legacy message, but still an error.
lines 52 and 53 look suspect - line 50 matches the bracket at the start of draw() so those two lines are just hanging... (probably because you didn't comment out line 47 when doing the 3 lines above it)