Pages: [1]   Go Down
Author Topic: Processing and Pachube  (Read 407 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Eureka does not mean what you think.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hello!
I am trying to make use of this code:
Code:
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
« Last Edit: January 19, 2010, 02:16:43 am by doctorwho8 » Logged

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

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

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Eureka does not mean what you think.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

/me
Logged

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

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

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Eureka does not mean what you think.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

/me
If time is relative does it have cousins?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Eureka does not mean what you think.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Pages: [1]   Go Up
Jump to: