Go Down

Topic: Processing and Pachube (Read 499 times) previous topic - next topic

doctorwho8

Jan 19, 2010, 05:59 am Last Edit: Jan 19, 2010, 08:16 am by doctorwho8 Reason: 1
[font=Times New Roman]
Hello!
I am trying to make use of this code:
Code: [Select]

import processing.serial.*;

import cc.arduino.*;

Arduino arduino;

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

[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]() {
 size(470, 280);
 arduino = [color=#CC6600]new[/color] Arduino([color=#CC6600]this[/color], Arduino.list()[0], 115200);
 
 [color=#CC6600]for[/color] ([color=#CC6600]int[/color] i = 0; i <= 13; i++)
   arduino.[color=#CC6600]pinMode[/color](i, Arduino.[color=#006699]INPUT[/color]);
}

[color=#CC6600]void[/color] draw() {
 background(off);
 stroke(on);
 
 [color=#CC6600]for[/color] ([color=#CC6600]int[/color] i = 0; i <= 13; i++) {
   [color=#CC6600]if[/color] (arduino.[color=#CC6600]digitalRead[/color](i) == Arduino.[color=#006699]HIGH[/color])
     fill(on);
   [color=#CC6600]else[/color]
     fill(off);
     
   rect(420 - i * 30, 30, 20, 20);
 }
 
 [color=#CC6600]for[/color] ([color=#CC6600]int[/color] i = 0; i <= 5; i++) {
   ellipse(280 + i * 30, 240, arduino.[color=#CC6600]analogRead[/color](i) / 16, arduino.[color=#CC6600]analogRead[/color](i) / 16);
 }
}


It was suggested in:
http://community.pachube.com/arduino/usb/processing#pachube-input

Version 17 complains of the import function. However there isn't enough information there to help me. Advice please.

The whole thing starts here:
http://www.pachube.com/

------
[/font]
(Edit: I do not kow why those strange colorization markers are here. I never see them on other code posts.)
/me

PaulS

Quote
Version 17 complains of the import function.


Version 17 of the Arduino IDE doesn't want to compile your Processing sketch? Well, there's a surprise.

Did you try compiling this using the Processing application?

http://processing.org/

doctorwho8

[font=Times New Roman]
Hello!
My point was that the examples themselves came from the main site for the system itself.
http://www.arduino.cc/playground/Interfacing/Processing.

Therefore there is something glaringly wrong with the example that I've chosen.
------
[/font]
/me

PaulS

The code that you posted is a Processing sketch. It needs to be compiled and run in the Processing application, not the Arduino application.

There is a separate sketch that needs to be uploaded to the Arduino.

The Processing sketch communicates, using the serial port, with the Arduino.

Were you trying to compile the code you posted in the Processing application or in the Arduino application?

doctorwho8

[font=Times New Roman]
Hello!
I confess that you maybe right. Given that the vast majority of people out there do not read completely instructions, or worse actually ignore them outright, it is a distinct possibilty that your advice is crystal clear and that I am not firing on all thrusters at the moment.

I will try this again later using the Processing kit and see what happens.
----
[/font]
/me
If time is relative does it have cousins?

doctorwho8

[font=Times New Roman]
Quote
The code that you posted is a Processing sketch. It needs to be compiled and run in the Processing application, not the Arduino application.

There is a separate sketch that needs to be uploaded to the Arduino.

The Processing sketch communicates, using the serial port, with the Arduino.

Were you trying to compile the code you posted in the Processing application or in the Arduino application?

---
Hello!
As it happens I did both. I prepared and installed the first part. The stuff that needs to finished via the regular interface for the device. It happens that I am now aware that the basic Processing engine needs to be built and installed via its tools.

The ones for Windows refused to launch, however the Linux one did. Therefore my next step will be to complete it that way.

I'll know more later.
-----
[/font]
/me
Time does not recognize a need for speed or politics.

Go Up