Pages: [1]   Go Down
Author Topic: Processing interfacing problems.  (Read 566 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 572
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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]
« Last Edit: October 22, 2008, 02:41:49 pm by mem » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow. Thanks a lot. It works now.
Logged

Pages: [1]   Go Up
Jump to: