Go Down

Topic: Processing interfacing problems. (Read 791 times) previous topic - next topic


I got my Arduino diecimila up and running a couple of days ago, so i wanted to play a little with the serial capabilities of the Arduino. I downloaded Processing, copied and pasted the processing code from this tutorial: http://arduino.cc/en/Tutorial/Dimmer and I copied the Arduino code as well. Then, I uploaded the scetch to the arduino board, and I pressed "run" in processing. The grayscale from the processing scetch shows up, but nothing happens when i move my mouse over it :'(

I hope, someone can help me.


Kind of hard to troubleshoot a problem with such little info, but the usual stuff to check would be

[1] Got the right bits of code in the right place? e.g. only the arduino bits uploaded to the arduino, only the processing bits run in the processing IDE (gotta ask - it's been done wrong before...)

[2] correct serial port selected in the processing sketch - remember it's not always the same number as in the arduino IDE


Yes, I copied the arduino code to the arduino IDE and the processing code to processing.

Processing is searching for the right COM port itself, and I don't get any error message.

This is what processing writes in the "black field":

Stable Library
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
  • "COM3"
    [1] "COM4"
    [2] "COM5"
    [3] "COM6"
    [4] "COM7"
    [5] "COM8"
    [6] "COM9"
    [7] "COM10"
    [8] "COM11"
    [9] "COM12"
    [10] "COM15"

    It stops on COM15, which is the port used in the Arduino IDE.


I've also tried all the other example processing scetches and they don't either.


You don't say if you have modified the processing sketch for com15 on your PC :  
 port = new Serial(this, Serial.list()[10], 9600);

Are you sure the LED is connected correctly? Perhaps try one of the other processing serial examples (like simpleRead) that can display data sent from the Arduino to verify that processing is accessing the correct com port.

Or, try a test with a sketch that changes the LED brightness using a potentiometer instead of the serial port


I've tried to change the COM port in the processing scetch to 15, but then I get this message:

Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 15
     at sketch_081022a.setup(sketch_081022a.java:38)
     at processing.core.PApplet.handleDraw(PApplet.java:1372)
     at processing.core.PApplet.run(PApplet.java:1300)
     at java.lang.Thread.run(Unknown Source)

And yes my LED connected right, cause when I run it with the fading scetch, it works fine.

I've also tested it with a pot and it works fine.

The other processing scetches doesn't work either.


Oct 22, 2008, 09:41 pm Last Edit: Oct 22, 2008, 09:41 pm by mem Reason: 1
the name 'com15' on your machine is port at index 10. try the code in my previous post

[glow]port = new Serial(this, Serial.list()[10], 9600);[/glow]


Wow. Thanks a lot. It works now.

Go Up