hi there!!! i was about 7 hours trying to set comunication between processing 2.0b8 and my Mega 2560, after reviewing forums all over the web and looking for information everywhere, i could solve the problem ... the problem consist in that when you try to communicate processing and arduino, if processing starts to send information too quickly , the Mega will locked (the LED on pin 13 will turn on and even resetting the card wont work while the board is receiving data). I solved it as follows:
you simply need to reset the card after establishing the comunicasion, but before it starts to send the information (before the RX led starts to turn on), to achieve this, we will need to put a delay in the processing code,just a few seconds, right after setting port, during this time we will need to press the RESET button to reset the card before it starts to receiving data, and there will be no problems with the transmission of data, I did it as follows:
port = new Serial (this, Serial.list () [1], 9600);
while (a < 3000) { / / cycle of 3 seconds duration, during this time
a = millis ();} / / you need to press the RESET buton.
que tal? estuve cerca de 7 horas tratando de establecer comunicación entre mi processing 2.0b8 y mi Mega 2560, después de revisar foros por toda la web y buscar información por doquier, logre resolver el problema... en si el problema consiste en que cuando intentas comunicar processing y arduino Mega, si processing envía información en cuanto arranca, la Mega se traba (el led del pin 13 se prende y ni reseteando la tarjeta funciona bien). la forma en que se soluciona es la siguiente:
simplemente necesitas resetear la tarjeta después de que se establece la comunicación, pero antes de que se empiece a enviar la información (antes de que el led RX se prenda), para lograr hacer esto necesitaremos poner un retraso en el código de prossesing de algunos segundos, justo después de establecer el puerto, Durante este tiempo necesitaras presionar el botón RESET de la tarjeta para reiniciarla y que no haya problemas con la transmisión de los datos, yo lo hice de la siguiente manera:
println(Serial.list());
port = new Serial(this, Serial.list()[1], 9600);
while( a < 3000){ //ciclo de 3 segundos de duracion durante este tiempo
a=millis();} // necesitaras precionar el boton RESET de tu tarjeta