Pages: [1]   Go Down
Author Topic: Troubles getting arduino_output running in Processing  (Read 5424 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Forum,

I'm just getting into Arduino and I was going through the youtube workshop and had no problems so far. But now, I've installed Processing and wanted to get the arduino_output example running. But I keep getting error messages.
The problems seems to be in the setup:

void setup() {
  size(470, 200);
  
  println(Arduino.list());
    arduino = new Arduino(this, Arduino.list()[0], 57600);
  
  for (int i = 0; i <= 13; i++)
    arduino.pinMode(i, Arduino.OUTPUT);
}


The error message is: "IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy"

Has anyone had the same problem?
The information on processing.org wasn't a big help.

Thanks
Ghoti_80
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46240
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Has anyone had the same problem?
On what OS? I've never seen that on Windows.
Logged

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

Quote
On what OS? I've never seen that on Windows.
I'm using Windows 7
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46240
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd recommend adding a couple of lines of code:
  println("COM Ports");
  println(Arduino.list());
  println("=========");
    arduino = new Arduino(this, Arduino.list()[0], 57600);

Then, show us what it printed.
Logged

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

I've added the lines and received this output:

COM Ports
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
[ 0 ] "COM13"
=========

and this error message that I've already received before:

Exception in thread "Animation Thread" java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy
   at cc.arduino.Arduino$SerialProxy.<init>(Arduino.java:119)
   at cc.arduino.Arduino.<init>(Arduino.java:168)
   at arduino_output.setup(arduino_output.java:43)
   at processing.core.PApplet.handleDraw(PApplet.java:2095)
   at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:197)
   at processing.core.PApplet.run(PApplet.java:1998)
   at java.lang.Thread.run(Thread.java:662)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46240
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're going to need to post your ENTIRE Processing sketch.
Logged

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

Oh, I'm sorry.

Here's the sketch:


import processing.serial.*;
import cc.arduino.*;
Arduino arduino;

color off = color(4, 79, 111);
color on = color(84, 145, 158);

int[] values = { Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW,
 Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW,
 Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW };

void setup() {
  size(470, 200);
 
  println("COM Ports");
  println(Arduino.list());
  println("=========");
 
  arduino = new Arduino(this, Arduino.list()[0], 57600);
 
  for (int i = 0; i <= 13; i++)
    arduino.pinMode(i, Arduino.OUTPUT);
}

void draw() {
  background(off);
  stroke(on); 
  for (int i = 0; i <= 13; i++) {
    if (values == Arduino.HIGH)
      fill(on);
    else
      fill(off);     
    rect(420 - i * 30, 30, 20, 20);
  }
}

void mousePressed()
{
  int pin = (450 - mouseX) / 30; 
  if (values[pin] == Arduino.LOW) {
    arduino.digitalWrite(pin, Arduino.HIGH);
    values[pin] = Arduino.HIGH;
  } else {
    arduino.digitalWrite(pin, Arduino.LOW);
    values[pin] = Arduino.LOW;
  }
}
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24449
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code tags would remove the italics.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

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

I'm having the exact same problem. I ran sample code given with the Arduino library for Processing (Which I'm assuming this is also).
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46240
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm having the exact same problem. I ran sample code given with the Arduino library for Processing
Well, there's just about enough information here to solve your problem. NOT.

What Processing application are you running? What Arduino code are you running? What operation system? What versions of Processing and Arduino?
Logged

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

It's the EXACT same problem as above, same code. The code is an example included in the Arduino library for Processing. I have the latest version of Arduino and Processing software. My Arduino is farily new arduino R3.

The problem is that processing will not attempt serial communication with the Ardunio period. The following code alone for example:




import processing.serial.*;

import cc.arduino.*;

Arduino myArduino;

void setup() {
  println(myArduino.list());
  myArduino = new Arduino(this, myArduino.list()[0], 57600);
}

void draw() {
  println("Hello world");
}



....gives the following error message....


Exception in thread "Animation Thread" java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy
   at cc.arduino.Arduino$SerialProxy.<init>(Arduino.java:119)
   at cc.arduino.Arduino.<init>(Arduino.java:168)
   at sketch_120910a.setup(sketch_120910a.java:32)
   at processing.core.PApplet.handleDraw(PApplet.java:2095)
   at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:197)
   at processing.core.PApplet.run(PApplet.java:1998)
   at java.lang.Thread.run(Thread.java:680)


Yes, I know the USB is not included in the list. I wasn't attempting to use it because it should have worked anyway.

Logged

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

Folks, I had the same problem and just managed to overcome it.  Here's how:  Do NOT download the newest version of Processing; rather download the last stable release which is 1.5.1 (the new release is the very source of the bugs, as the Processing has been revised but the Arduino libraries have not).  Once you've done that, you will need to update you're RXTX libraries (there is a mismatch, follow the direction contained in the following link: http://forum.processing.org/topic/how-do-i-install-rxtx-2-2pre1-jar-on-windows-7     

A couple side notes, I've got a Arduino Mega 2560 communicating with at Windows 7 machine. 

Best of luck my friends! 

-Matt
Logged

Seattle, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks so much, Matt/mellis20!  I had even gone to install from the latest in svn, but going back to 1.5.1 worked for me.  I'm on Mac OS X 10.8.1.  I didn't get any message complaining about RX/TX so kept with what I had.   
Logged

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

I can confirm that on Mac OSX 10.8.4 that I had the same issue and it was resolved by rolling back the version. I would also like to note that this is not the first time I've had a issue 2.0 + and libraries looks like I'll be sticking to 1.5.1.
Logged

Auckland, NZ
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was having this issue also. I noticed the Processing library has actually been updated to 2.0 here on Github. So I cloned it, built it with ant, and uploaded the Processing 2.0 libraries to the Arduino Playground page.

Hope this helps,
Don
Logged

Pages: [1]   Go Up
Jump to: