avdwebLibraries / avdweb_Switch

Switch library with longPress and doubleClick
http://www.avdweb.nl/arduino/hardware-interfacing/simple-switch-debouncer.html
GNU General Public License v3.0
45 stars 16 forks source link

Feature request - allow users to set long press duration #10

Closed zainulaabdin closed 6 years ago

zainulaabdin commented 6 years ago

Thank you very much for creating this library. I like it, however, I badly need to be able to change the long press duration. Thanks

avandalen commented 6 years ago

do this in the code

From: Zainul Aabdin Sent: Saturday, October 13, 2018 2:37 PM To: avandalen/avdweb_Switch Cc: Subscribed Subject: [avandalen/avdweb_Switch] Feature request - allow users to set long press duration (#10)

Thank you very much for creating this library. I like it, however, I badly need to be able to change the long press duration. Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Martin-Laclaustra commented 6 years ago

You do not need to modify the library. I suggest that you use the appropriate argument in the creator. These are the defaults:

Switch(byte _pin, byte PinMode=INPUT_PULLUP, bool polarity=LOW, int debouncePeriod=50, int longPressPeriod=300, int doubleClickPeriod=250, int deglitchPeriod=10);

zainulaabdin commented 6 years ago

Thank you both for the prompt reply and help. You may close this now.