Hi,
I am trying to read an analog pin from Processing using Firmata (just to be safe).
I connected a voltage divider to pin3 and verified that everything is ok using a different sketch on the arduino (println gives me a reasonable value: 508).
I uploaded the StandardFirmata sketch to the arduino and run it, then I wrote the short processing sketch below (I tried with 115200 and 57600 as port speed, no change).
Arduino.List() gives me a reassuring message:
Stable Library
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
[0] "COM6"
but then I see just a series of 0s, and no apparent TX/RX led blinking on the arduino. Are there known issues with the duemilanove platform? Or (more possible) am I doing something wrong?
Thanks in advance, and sorry for the trivial question!
edo
Processing code:
import processing.serial.;
import cc.arduino.;
Arduino arduino;
int pin3_val;
void setup()
{
println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 57600);
}
void draw()
{
pin3_val = (int) arduino.analogRead(3);
println(pin3_val);
delay(1000);
}