Go Down

Topic: Uno Reset button gives value of HIGH when not pushed and LOW when pushed (Read 267 times) previous topic - next topic

ParsonsDavid

When the reset button on my Uno is not pushed, there is 5 volts across each side. When the button is pushed, there is 0 volts across the side with the three pins, measuring between the outside pins.

I'm a beginner, but this seems wrong. If so, how can I correct it, or is it a defect in the Uno board.

Thanks,

Dave Parsons

CrossRoads

That is  correct operation.
Reset pin needs to be  High for normal operations.

Time to get used to Negative logic:
High = button not pushed.
Low = button pushed.

Code: [Select]

byte pin2 = 2; // pinD2, connect button/switch from D2 to Gnd
byte ledPin = 13; // onboard LED

void setup(){
pinMode (pin2, INPUT);  // read pin D2
digitalWrite (pin2, HIGH); // enables internal pullup resistor

pinMode(ledPin, OUTPUT);  //drive on-board LED
digitalWrite(ledPin, LOW);
} // end setup

void loop(){
if (digitalRead(pin2) == LOW){  // button from pin2 to Gnd pressed?
  digitalWrite(ledPin, HIGH); // turn on on-board LED
}
else{  // turn it off
digitalWrite(ledPin, LOW);
}
} // end loop

Make sense? High is the "off" state, and Low is the "on" state
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up