ALL PINS ARE HIGH

Hi,

Now m working with firmata, after successfully completion of all the project i switched off my board,

after next day when i powered on bored , all pin giving high value.

my board giving reverse response.

means in firmata , all pins should be low at starting but here m getting all pins high, and when in firmata test application m pressing low then my all pins getting high and when m pressing high my all pins giving 0 output.

You sound confused and so am I can you be more specific about how you have wired things up and what code you are communicating to the arduino with.

all pins should be low at starting

Not necessarily. At starting they are undefined.

First of all thanks for interest,

i am working on one project in which i want to control relay by key board,

like when i press key "A" than pin 1 should on, i have completed this project by StandardFirmata which is available in example,

first(befor this problem) after uploading StandardFirmata to my arduino board all pins giving low output at the start up,

but now my all pins giving high(5v) at startup , even without any control through firmata test application.

yesterday it was working perfectly.

import processing.serial.*;

import cc.arduino.*;

Arduino arduino;

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

int[] values = { Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW,
 Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW,
 Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW };

void setup() {
  size(470, 200);
  
  println(Arduino.list());
  arduino = new Arduino(this, Arduino.list()[0], 57600);
  
  for (int i = 0; i <= 13; i++)
    arduino.pinMode(i, Arduino.OUTPUT);
}

void draw() {
  background(off);
  stroke(on);
  
  for (int i = 0; i <= 13; i++) {
    if (values[i] == Arduino.HIGH)
      fill(on);
    else
      fill(off);
      
    rect(420 - i * 30, 30, 20, 20);
  }
}

void keyPressed(){
  int pin = -1;
  if( key == 'a' || key == 'A' ){
    pin = 0;
  }
  if( key == 'b' || key == 'B' ){
    pin = 1;
  }
  if( key == 'c' || key == 'C' ){
    pin = 2;
  }
  if( key == 'd' || key == 'D' ){
    pin = 3;
  }
  if( key == 'e' || key == 'E' ){
    pin = 4;
  }
  if( key == 'f' || key == 'F' ){
    pin = 5;
  }
  if( key == 'g' || key == 'G' ){
    pin = 6;
  }
  if( key == 'h' || key == 'H' ){
    pin = 7;
  }
  if( key == 'i' || key == 'I' ){
    pin = 8;
  }
  if( key == 'j' || key == 'J' ){
    pin = 9;
  }
  if( key == 'k' || key == 'K' ){
    pin = 10;
  }
  if( pin != -1 && pin < values.length ){
    if (values[pin] == Arduino.LOW) {
      arduino.digitalWrite(pin, Arduino.HIGH);
      values[pin] = Arduino.HIGH;
    } else {
      arduino.digitalWrite(pin, Arduino.LOW);
      values[pin] = Arduino.LOW;
    }
  }
}
int[] values = { Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW,
 Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW,
 Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW, Arduino.LOW };

Telling Processing this, without telling the Arduino this seems bound to cause confusion. You are confused, no?

Hi PaulS,

Same here m also confused about this behavior,

already defined "Arduino.LOW" but i dont know why alll pins are giving high output..

chetan

already defined "Arduino.LOW"

You already defined what Arduino.LOW? The pin state that processing knows? Or, the actual state of the pin on the Arduino?