Movatterモバイル変換


[0]ホーム

URL:


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

AddgetDirection() support toModulinoKnob and example ⚡#34

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

AntonioBerna
Copy link
Contributor

@AntonioBernaAntonioBerna commentedMay 1, 2025
edited
Loading

📝 Description

This PR introduces support for detecting rotation direction in theModulinoKnob class via a new method:

  • getDirection() returns1 for clockwise,-1 for counter-clockwise, and0 when no movement is detected (debounced).
  • 🧠 Internal debouncing is handled viaDEBOUNCE_DELAY to avoid noisy reads.
  • 🛠️ Thebegin() logic now initializes internal state (_lastPosition,_lastDebounceTime) accordingly.
  • 🧪 Thebasic example sketch has been updated to demonstrate the use ofgetDirection().

🔁 Related Work

Fixed#9

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'`) matchingthe physical button labeling.Closesarduino-libraries#3
@per1234per1234 added the enhancementNew feature or request labelMay 2, 2025
@leonardocavagnisleonardocavagnis self-requested a reviewMay 8, 2025 14:08
Copy link
Contributor

@leonardocavagnisleonardocavagnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for contribution!
Please, take a look to my review. Minor fixes

.gitignore Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Remove this file.
It is already included in the PR#33

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Revert this file :)
this modifies doesn't add any feature to the PR

}
return ret;
}
int16_tget() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

remove it.
it is already included in the PR#32

if (res ==false) {
return0;
}
get(buf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same here
it is already included in the PR#32

@AntonioBerna
Copy link
ContributorAuthor

@leonardocavagnis I apologize for creating problems with the files but I had accidentally merged the changes of PR#33 into themain branch of theModulino repository fork and when I created the branch for PR#34 the changes were automatically added.

With commit66200f1 this PR is affected topull request is merged indirectly or is still processing updates.

For this reason with commitcff95ab everything should be fixed correctly.

I remain waiting for further developments. Enjoy 🎉

leonardocavagnis reacted with heart emoji

Copy link
Contributor

@leonardocavagnisleonardocavagnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM :)

@leonardocavagnisleonardocavagnis merged commit3c36732 intoarduino-libraries:mainMay 9, 2025
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@leonardocavagnisleonardocavagnisleonardocavagnis approved these changes

Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add function for Modulino Knob to detect direction
3 participants
@AntonioBerna@leonardocavagnis@per1234

[8]ページ先頭

©2009-2025 Movatter.jp