PicoLC Arduino Library Arduino library for PicoLC hardware |
Represents one filtered, logical PicoLC button. More...
#include <PicoLCButton.h>
Public Member Functions | |
| bool | read () const |
| Returns the current filtered logical button state. | |
| bool | rising () const |
| Reports a logical button press transition. | |
| bool | falling () const |
| Reports a logical button release transition. | |
| bool | changed () const |
| Reports any logical button transition. | |
| void | filterMillis (uint32_t ms) |
| Sets the required button-state stability time. | |
| uint32_t | filterMillis () const |
| Returns the configured button-state stability time. | |
Friends | |
| class | PicoLC |
Represents one filtered, logical PicoLC button.
PicoLCButton samples a board-defined button during PicoLC::update(), applies its configured inversion, then applies the configured stability filter before updating the logical button state. Edge detection operates only on the resulting logical state.
Instances are created and owned by PicoLC and are accessed through members such as PicoLC::BootButton, PicoLC::RunStopButton, and PicoLC::UserButton.
Definition at line 18 of file PicoLCButton.h.
| bool PicoLCButton::changed | ( | ) | const |
Reports any logical button transition.
Filtering and inversion are applied before change detection. The result remains true for the current scan and is cleared by the next PicoLC::update().
Definition at line 65 of file PicoLCButton.cpp.
| bool PicoLCButton::falling | ( | ) | const |
Reports a logical button release transition.
Filtering and inversion are applied before edge detection. The result remains true for the current scan and is cleared by the next PicoLC::update().
Definition at line 58 of file PicoLCButton.cpp.
| uint32_t PicoLCButton::filterMillis | ( | ) | const |
Returns the configured button-state stability time.
Definition at line 43 of file PicoLCButton.cpp.
| void PicoLCButton::filterMillis | ( | uint32_t | ms | ) |
Sets the required button-state stability time.
A value of zero disables filtering and applies the sampled logical state during the next PicoLC::update(). Changing the duration does not restart an active filter interval; the new value is compared against the existing elapsed interval during the next update.
| ms | Required stability time in milliseconds. |
Definition at line 39 of file PicoLCButton.cpp.
| bool PicoLCButton::read | ( | ) | const |
Returns the current filtered logical button state.
The value is true when the button is logically pressed and changes only during PicoLC::update().
Definition at line 47 of file PicoLCButton.cpp.
| bool PicoLCButton::rising | ( | ) | const |
Reports a logical button press transition.
Filtering and inversion are applied before edge detection. The result remains true for the current scan and is cleared by the next PicoLC::update().
Definition at line 51 of file PicoLCButton.cpp.
| friend |
Definition at line 19 of file PicoLCButton.h.