so i dont need any firmata or sketch to connect arduino to processing???
if i can just output a value in the serial port, and read it in processing how would i do this?? read the value in the port?
You need a sketch in the arduino, that you have already. Get rid of the strings like the cm on the reading to make things easier.
To read it in processing you the code I have posted.
What is wrong with you? You seem to be totally ignoring everything we say. You keep asking the same question over and over and ignoring the answer.
Maybe this whole project is just too much for you. I would advise doing some simpler projects and learning some stuff until you get a clue. Then come back to this and read the answers you have been given again.