Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button library has bounce issues #15

Closed
AlexanderBrevig opened this issue Mar 30, 2012 · 0 comments
Closed

Button library has bounce issues #15

AlexanderBrevig opened this issue Mar 30, 2012 · 0 comments

Comments

@AlexanderBrevig
Copy link
Member

AlexanderBrevig commented Mar 30, 2012

Thanks to: Vytautas Janušonis

Reproduce errors using:

include <Button.h>

Button button = Button(2,PULLUP);

int counter = 0;

void setup()
{
pinMode(13, OUTPUT); //debug to led 13
Serial.begin(9600);
}

void loop()
{
if(button.uniquePress()) // kitos galimos funkcijos: | isPressed() | wasPressed() | stateChanged()
{
counter++;
Serial.print("On\n");
Serial.println(counter);
digitalWrite(13,HIGH);
}
}

I guess we should add some debounce time constant as to prevent a high frequency registration of presses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant