Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for character input ('A', 'B', 'C') in isPressed() #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

AntonioBerna
Copy link
Contributor

This PR adds the ability to call isPressed() using either numeric indices (0–2) or the character/string identifiers 'A', 'B', and 'C', aligning with the button labels.

This makes user code more intuitive when referencing button inputs.

Fixes #3

Added support for character and string-based input to `isPressed()` in `ModulinoButtons`,
so it now accepts both index (0–2) and letter identifiers (`'A'`, `'B'`, `'C'`) matching
the physical button labeling.

Closes arduino-libraries#3
@CLAassistant
Copy link

CLAassistant commented Apr 30, 2025

CLA assistant check
All committers have signed the CLA.

@per1234 per1234 added the enhancement New feature or request label Apr 30, 2025
@leonardocavagnis
Copy link
Contributor

@AntonioBerna Thanks for contribution!
Please, update the api.md file with new APIs

@AntonioBerna
Copy link
Contributor Author

@leonardocavagnis with commit b8a67c7 I complete the update of api.md file.

@leonardocavagnis leonardocavagnis merged commit 9c948fe into arduino-libraries:main May 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the possibility to address buttons with letters
4 participants