I've made a program on processing that plots the data coming in from my device, on real time monitoring system graph and also saves it on an excel file. So basically I upload the programto arduino ( (from the Arduino IDE) ) that is connected to my device. And then run processing to plot and save data.
Now the question is, this program works like a charm on processing with the arduino UNO, but not with with my mega board 1280?
Btw, yes my program on processing does display the COM ports (eg COM PORT 1) before connecting to the serial ports. My buade rate is 9600.
The pins Im using on arduino uno or processing are plane simple. 5V, Ground (from the pwn side) and then A0 for analog signal. I am not sure if its the pins that are the problem.
Okay basically I need to learn how to tweet on twitter without using the arduino ethernet shield. YES my arduino is connected to the computer. I am very new to processing and the reading code on processing is very hard to understand.
So basically my arduino fires values from my sensor and there's an if statement that says,
if the value>15, "we have a problem"
I want to learn how can I tweet this directly from my arduino to twitter using processing.
I've been researching for weeks now, and a lot of the code which i've managed to compile, but they all open with small windows and but no tweeets on twitter are coming.
I tried to test the code below with my orignal program on arduino. The twitter code on processing worked saying COLOUR SELECTED: 15.96. BUT NO TWITTER TWEET.
Then i tired to test it with a simple program on the arduino. When I complied the twitter code on processing, it says color selected is NULL. NO TWEET ON MY TWITTER
Serial myPort; // The serial port
PFont myFont; // The display font
String inString; // Input string from serial port
int lf = 10; // ASCII linefeed
Twitter twitter; // Twitter
//Going to get oAuth working instead of this, but this will do for now
String username = "YOUR-TWITTER-USERNAME"; // you Twitter Username Here
String password = "YOUR-TWITTER-PASSWORD"; // your Twitter Password Here
void setup() {
size(400,200);
twitter = new Twitter(username,password);
myFont = loadFont("AppleGothic-48.vlw");
textFont(myFont, 18);
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 9600);
myPort.bufferUntil(lf); //wiat for line feed to specify end of serial buffer
}
void serialEvent(Serial p) {
inString = p.readString();//read serial string
//For some reason this only wanted to work in a try catch
try
{
Status status1 = twitter.updateStatus("Arduino's favorite color is "+inString);//update twitter status
}
catch( TwitterException e) {
println(e.getStatusCode());
}
}
Make sure you change USERNAME and PASSWORD with your twitter accounts username and password.
Make sure that you only use serial.println command on whatever you want to post on twitter.