Serial communication


I’m experiencing a little problem with the serial communication (ARDUINO + PROCESSING) with my arduino BT. The processing program only works properly if I reset the arduino just after a play the processing code. My doubt is: is there a way of doing that communication works without being necessary to reset the arduino?
The part of the code that makes the communication is the following (based in the examples of the arduino)

void draw() {
  while (port.available() > 0){
  println ("value: "+val);
void serialEvent(int serial) 
  if(serial != NEWLINE) { 
    buff += char(serial);
  } else {
    buff = buff.substring(0, buff.length()-1);
    val = Integer.parseInt(buff);
    buff = "";

In the arduinoBT I’m using the Serial.print(), with a delay of 100 between two messages.

If I don’t push the reset button, the processing just prints “value: 0”.

Any ideas?

My arduino is the BT-06, with processing-0135 in Windows XP SP2


I think this is caused by boot routine in your ATMEGA.

Try wait about 3 seconds before listen Serial port. Wait this 3 seconds before Serial.Begin command.

I think it will work.