mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* MomentaryButton: added support for analog button (with threshold)
* RAK: support for PIN_USER_BTN_ANA
This commit is contained in:
parent
b8223e9d07
commit
74722c24b8
5 changed files with 39 additions and 3 deletions
|
|
@ -11,12 +11,14 @@ class MomentaryButton {
|
|||
int8_t prev, cancel;
|
||||
bool _reverse, _pull;
|
||||
int _long_millis;
|
||||
int _threshold; // analog mode
|
||||
unsigned long down_at;
|
||||
|
||||
bool isPressed(int level) const;
|
||||
|
||||
public:
|
||||
MomentaryButton(int8_t pin, int long_press_mills=0, bool reverse=false, bool pulldownup=false);
|
||||
MomentaryButton(int8_t pin, int long_press_mills, int analog_threshold);
|
||||
void begin();
|
||||
int check(bool repeat_click=false); // returns one of BUTTON_EVENT_*
|
||||
void cancelClick(); // suppress next BUTTON_EVENT_CLICK (if already in DOWN state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue