Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

@AntonioBerna AntonioBerna commented Apr 30, 2025

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 
Copy link

CLAassistant commented Apr 30, 2025
edited
Loading

CLA assistant check
All committers have signed the CLA.

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

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

AntonioBerna reacted with thumbs up emoji

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

Reviewers

@leonardocavagnis leonardocavagnis leonardocavagnis requested changes

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add the possibility to address buttons with letters

AltStyle によって変換されたページ (->オリジナル) /