RGB Led and processing

Hi, i followed everything in this blog to make an rgb led but i have a problem with processing
blog : Labs
error :

WARNING:  RXTX Version mismatch
	Jar version = RXTX-2.2pre1
	native lib Version = RXTX-2.2pre2
[0] "COM3"
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 1
	at sketch_may22a.setup(sketch_may22a.java:48)
	at processing.core.PApplet.handleDraw(Unknown Source)
	at processing.core.PApplet.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:662)
WARNING:  RXTX Version mismatch
	Jar version = RXTX-2.2pre1
	native lib Version = RXTX-2.2pre2
[0] "COM3"
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 1
	at sketch_may22b.setup(sketch_may22b.java:48)
	at processing.core.PApplet.handleDraw(Unknown Source)
	at processing.core.PApplet.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:662)

I think the problem is this:

 println(Serial.list());
  port = new Serial(this, Serial.list()[1], 9600);

Your output shows that there is only one element in the list of serial ports. Element 0. Then the code tries to use element 1. That's going to fail.

so what should i do?
do you have another tutorial to make an rgb led work with arduino?

I would change it to:

 println(Serial.list());
  port = new Serial(this, Serial.list()[0], 9600);

It's working thank you :slight_smile:
do you know any better procceing code for rgb led control?