processing and arduino.digitalRead

Hi,

I am experiencing some problems to read the value from an arduino pin. My Arduino board is a declimila (just in case this matters).

The LED on pin 13 does bink in a cycle as expected but for some reason the digital read is always equal to 0.

Am I doing some thing wrong?

this is the code I am using in processing:

import processing.serial.; import cc.arduino.;

Arduino arduino;

int tempPin = 13;

void setup() { println(Arduino.list()); arduino = new Arduino(this, Arduino.list()[0], 57600); arduino.pinMode(tempPin, Arduino.INPUT); }

void draw() {

arduino.pinMode(tempPin, Arduino.OUTPUT); arduino.digitalWrite(tempPin , Arduino.HIGH); delay(1000); arduino.pinMode(tempPin, Arduino.INPUT); delay(2); println(arduino.digitalRead(tempPin)); delay(1000);

arduino.pinMode(tempPin, Arduino.OUTPUT); arduino.digitalWrite(tempPin , Arduino.LOW); delay(1000); arduino.pinMode(tempPin, Arduino.INPUT); delay(2); println(arduino.digitalRead(tempPin)); delay(1000);

}

ok no longer need help it looks the firmdata I was using was the problem.

I now use the one provided in the zip file here http://www.arduino.cc/playground/Interfacing/Processing

and everything is fine.

i follows your same steps but don't work for me! i upload the firmdate too!

can somebody helps me? thanks!

We need to see the sketch you loaded on the Arduino. Not a link to a web site where you got it from.

We need to know what you have connected to the Arduino, where, and how.

We need to see your Processing sketch.

We need to know what "i follows your same steps but don't work for me!" means. What doesn't work?

Then, maybe we can help.