digital in problem

Hello,
I'm trying to use firmata and processing to communicate with the my arduino. I've done this before but recently did a few several upgrades and now I have problems.
Processing 1.0.6
Arduino 17
Duemilanove
Snow leopard
I have the recent adruino library in the processing folder, and the snow leopard USB driver.

I can get the hello world blinking led to work, however the digital input is not working.
println(arduino.digitalRead(2)); gives the value of 0. I have a pulldown resistor and am confident that the hardware is wired correctly.

This is the case with both the stand firmata versions 1 and 2
Any ideas?

Could we take a look at your code?

You could have missed pinMode(button, INPUT); But it sounds like a code problem personally.
It may not make a big difference, but you can declare digitalRead(2) as a boolean, so it'll output either HIGH, or LOW respectively. And then just printing whatever you declared into the Serial instead.

Just realized you're using the Processing with Firmata, not sure if they work the same, with the INPUTS and such.. so hopefully this helped!
If not, sorry for the waste:D
Best of luck!

Okay, I'll be more specific - I think the problem has to do with a combination of the latest arduino, latest Processing, and latest Firmata all communicating - or of course I'm just doing something stupid. :o

But I don't think so.

If I ignore firmata and upload this code on the arduino
int switchPin = 4; // Switch connected to pin 4
void setup() {
pinMode(switchPin, INPUT); // Set pin 0 as an input
Serial.begin(9600); // Start serial communication at 9600 bps
}
void loop() {
if (digitalRead(switchPin) == HIGH) { // If switch is ON,
Serial.print(1, BYTE); // send 1 to Processing
} else { // If the switch is not ON,
Serial.print(0, BYTE); // send 0 to Processing
}
delay(100); // Wait 100 milliseconds
}

and this code on processing

import processing.serial.*;

Serial myPort; // Create object from Serial class
int val; // Data received from the serial port

void setup()
{
size(200, 200);
String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);
}

void draw()
{
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
}
println(val);
}

... then the button works fine, so I know the problem is not with my circuit or the hardware.

BUT if i use standard firmata (or standardFirmata_2) on the arduino, and this code ..
import processing.serial.;
import cc.arduino.
;
Arduino arduino;
int buttonPin = 4;
void setup(){
size (300, 300);
arduino = new Arduino(this, Arduino.list()[0]);
arduino.pinMode(buttonPin, Arduino.INPUT);// sets port 2 to input
}
void draw(){
println(arduino.digitalRead(buttonPin):
}

... in Processing, it does not work.
Any ideas?

I've found that SimpleDigitalFirmata is working fine, but StandardFirmata is not, at least with my setup.