#include <modm/ui/button_group.hpp>
template<std::unsigned_integral T = uint8_t>
class modm::ButtonGroup< T >
- Template Parameters
-
T | Storage type for Button states. Each button requires one bit. |
template<std::unsigned_integral T = uint8_t>
modm::ButtonGroup< T >::ButtonGroup |
( |
T |
repeatmask, |
|
|
uint16_t |
timeout = 50 , |
|
|
uint16_t |
interval = 20 |
|
) |
| |
|
inline |
template<std::unsigned_integral T = uint8_t>
bool modm::ButtonGroup< T >::isPressed |
( |
T |
mask | ) |
|
|
inline |
Check if a key has been pressed. Each pressed key is only reported once.
...
while (true) {
...
if (buttons.
isPressed(modm::ButtonGroup::BUTTON0)) {
}
}
template<std::unsigned_integral T = uint8_t>
bool modm::ButtonGroup< T >::isPressedLong |
( |
T |
mask | ) |
|
|
inline |
Get buttons which were pressed long
- Warning
- Use this function only in combination with
isPressedShort()
, otherwise it will not work correctly!
- See also
- isPressedShort()
template<std::unsigned_integral T = uint8_t>
bool modm::ButtonGroup< T >::isPressedShort |
( |
T |
mask | ) |
|
|
inline |
Get buttons which were pressed short.
...
while (true) {
...
}
}
}
- Warning
- Use this function only in combination with
isPressedLong()
, otherwise it will not work correctly!
- See also
- isPressedLong()
template<std::unsigned_integral T = uint8_t>
bool modm::ButtonGroup< T >::isRepeated |
( |
T |
mask | ) |
|
|
inline |
Check if a key has been pressed long enough such that the key repeat functionality kicks in.
After a small setup delay the key is reported being pressed subsequent calls to this function. This simulates the user repeatedly pressing and releasing the key.
...
while (true) {
...
if (buttons.
isPressed(modm::ButtonGroup::BUTTON0) ||
{
}
}
- See also
- isPressed()
template<std::unsigned_integral T = uint8_t>
void modm::ButtonGroup< T >::update |
( |
T |
input | ) |
|
|
inline |
Update internal debounced. Call this function periodically every 5 to 10ms.
- Parameters
-
input | Inverted input signals |
The documentation for this class was generated from the following file: