Pages: [1]   Go Down
Author Topic: RGB Led and processing  (Read 1550 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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)
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8081
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the problem is this:
Code:
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.
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 180
Posts: 8081
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would change it to:

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

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

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: