Go Down

Topic: RGB Led and processing (Read 1 time) previous topic - next topic

hitekos

Hi, i followed everything in this blog to make an rgb led but i have a problem with processing
blog : http://blog.bsoares.com.br/processing/controlling-rgb-led-with-arduino-and-processing
error :
Code: [Select]
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)

johnwasser

I think the problem is this:
Code: [Select]

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

hitekos

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

johnwasser

I would change it to:

Code: [Select]

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

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

hitekos

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

Go Up