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

function to retrieve number of buttonclicks and short or long press? #42

Closed
dsyleixa opened this issue Nov 28, 2018 · 1 comment
Closed

Comments

@dsyleixa
Copy link

dsyleixa commented Nov 28, 2018

hello,
how about a function to retrieve the number of buttonclicks and/or short or long press?
e.g.


void loop() {
  button1.tick();
 button2.tick();

  if(button1.click()) {  // returns 0 if no click  - or number of clicks or long press
     Serial.println(button1.click() ); //  1 for single click , 2 for doubleClick, 3 for long press
  }

// or
   if(button2.click() == 1) {do something ;}
   if(button2.click() == 2) {do other special;}
   if(button2.click() == 3) {do something else;}

  delay(10);
} // loop

@dsyleixa dsyleixa changed the title function to retrive number of buttonclicks and short or long press? function to retrieve number of buttonclicks and short or long press? Nov 28, 2018
@mathertel
Copy link
Owner

see #50

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

No branches or pull requests

2 participants