Well, I've answer my own question after hours and hours of search and experimentations. Here is the answer:
1-It appear that the 'serial initialization code' don't like to be load after the 'Capture initialization code'. So I moved all 'serial code' to just a line before the corresponding 'capture code'. EX:
Before:
Quote:
import processing.video.*;
import processing.serial.*;
Serial port;
Capture cam;
void setup(){
size(480,480, P3D);
port = new Serial(this, Serial.list()[0], 9600);
cam = new Capture(this, 6, 6, 15);
}
void draw(){
//code...
}
After:
Quote:
import processing.video.*;
import processing.serial.*;
Capture cam;
Serial port;
void setup(){
size(480,480, P3D);
cam = new Capture(this, 6, 6, 15);
port = new Serial(this, Serial.list()[0], 9600);
}
void draw(){
//code...
}
It's a strange solution but it's working!
Note that the line 'port = new Serial(this, Serial.list()[0], 9600);' is AFTER the 'size(480,480, P3D);' line. If you want to solve the
Quote:gnu.io.PortInUseException: Unknown Application
at
gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
error the serial code should always be after the 'size' line. Why? well... I don't know I found this solution at
http://todbot.com/blog/2008/01/14/in-processing-size-matters-for-serial-ports/
I hope it will help someone.