mathertel / OneButton

An Arduino library for using a single button for multiple purpose input.
http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
Other
920 stars 230 forks source link

Fix #91 and #88 #124

Closed IhorNehrutsa closed 1 year ago

IhorNehrutsa commented 1 year ago

Add getPressedMs() function.

Add LongPressEvents.ino example.

OneButton Example.
Please press and hold the button for a few seconds.
810  - LongPressStart()
820  - DuringLongPress()
1820     - DuringLongPress()
2820     - DuringLongPress()
3820     - DuringLongPress()
4820     - DuringLongPress()
5820     - DuringLongPress()
6550     - LongPressStop()

In the first column, milliseconds from the start of pressing the button.

mathertel commented 1 year ago

Thanks a lot for the contribution. This is welcome.

Please fix the typo: _long_press_intrval_ms => _long_press_interval_ms. Please add some instructive comments at the begin of the new example.

mathertel commented 1 year ago

Thanks a lot !

IhorNehrutsa commented 1 year ago

Please bump the version and library.json Thanks