Pages: [1]   Go Down
Author Topic: ALL PINS ARE HIGH  (Read 598 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33314
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
all pins should be low at starting

Not necessarily. At starting they are undefined.

http://www.gammon.com.au/switches

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  


Code:
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;
    }
  }
}
« Last Edit: March 03, 2013, 04:24:43 am by chetan0412 » Logged

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

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

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

Pages: [1]   Go Up
Jump to: