Add a slightly more complex example that uses every button type.
This commit is contained in:
parent
763e55d518
commit
97056ddee6
3 changed files with 25 additions and 2 deletions
|
@ -163,7 +163,7 @@ void Joystick::_UpdateButton(Button& button, uint8_t index) {
|
|||
if (button.pullup) value = _InvertSignal(value);
|
||||
|
||||
switch (button.type) {
|
||||
case BUTTON_MAINTAINED:
|
||||
case BUTTON_LATCHED:
|
||||
if (value == HIGH) PressButton(index);
|
||||
else ReleaseButton(index);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue