Here is a processing sketch I found on the web that creates a bar graph based on serial input from your arduino. The Arduino must send a byte with a value of 0 to 255. Run the sketch and look at the text in the area that reports errors, that will tell you what number goes in this part:
arduinoPort = new Serial(this, Serial.list()[0], 115200);// [0] is the indicator for the port could be 0 ,1,2,3 etc.
/////////////////////////////////////////
//This example reads in a single byte value from 0 to 255 and graphs it.
//Basic serial communication code
//by Chang Soo Lee
//ITP, NYU
//Created 11/27/2005
/////////////////////////////////////////
import processing.serial.*;
Serial arduinoPort;
int serial = 1;
PFont font;
int numH = 370;
void setup()
{
size(270, 440);
println(Serial.list());
arduinoPort = new Serial(this, Serial.list()[0], 115200);
// Load the font. Fonts must be placed within the data
// directory of your sketch. Use Tools > Create Font
// to create a distributable bitmap font.
// For vector fonts, use the createFont() function.
println("ready for use");
font = loadFont("ArialMT-48.vlw");
smooth();
}
void draw () {
background(255);
if (arduinoPort.available() > 0) {
serial = arduinoPort.read();
}
line(70, 70, 70, 370);
line(70, 370, 200, 370);
fill(0);
textFont(font, 11);
text("Sensor\nValue", 22, 80);
text("Analog Input", 95, 390);
text(serial, 25, 110);
fill(100 - serial, 0, 255 - serial * 2);
rect(120, numH-serial * 3, 20, serial * 3);
}
EDIT: Made a mistake with code tags, message was confusing.