bounce w/ 10k?

Status
Not open for further replies.

jd911

Member
Is there any need to put a 10k pullup resistor on push buttons when using the bounce library?

muchas gracias
 
The pullup is still needed. Without the pullup, the pin could continually bounce from 0 to 1 without ever settling down.
You can, of course, use the internal pullup instead of an external 10k resistor.
Code:
  pinMode(whichever_pin,INPUT_PULLUP);

Pete
 
i was just wondering if bounce already implemented internal pullup. I've tried it both ways and don't see any difference. But some projects in the past have started fine and needed this type of correction later.
Thanks
 
i was just wondering if bounce already implemented internal pullup. I've tried it both ways and don't see any difference. But some projects in the past have started fine and needed this type of correction later.
Thanks
The easiest thing to do in cases like this is to look at the sources... Bounce library is installed with Teensyduino, the sources are at:
<where you installed arduino>/hardware/teensy/avr/libraries/Bounce

And if you look at the sources, the only thing the code does with the pin number is digitalRead. Or a digitalWrite if you call the write method.

So If your button is hooked up, such that it is floating when the button is not pressed, then you probably need to do:
pinMode(pin, INPUT_PULLUP) - If your button is hooked up such that the other side of the button goes to ground.

or

pinMode(pin, INPUT_PULLDOWN) - If your button is hooked up such that the other side is connected to 3.3v or the like. In this case the risingEdge/fallingEdge method usage will be opposite as pushing the button would cause the button value to RISE and release will cause it to FALL...
 
what if you just hook the pullup resistor to v+ and the input pin to the gnd and hit the one in the middle?
 
If the input pin is connected directly to ground, it will always be at ground and will always read LOW.
Just use the internal pullup. It's so much easier.

Pete
 
Status
Not open for further replies.
Back
Top