Skip to content
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

Implement Rotary Encoder #123

Closed
wants to merge 39 commits into from
Closed

Implement Rotary Encoder #123

wants to merge 39 commits into from

Conversation

harshil21
Copy link
Member

Implements the rotary encoder into the code.

As of right now, there is only a testing script which prints a super basic GUI to control the servo and print the encoder position.

Run with: uv run scripts/run_servo_and_encoder.py.

merge after #121

@harshil21 harshil21 added the enhancement New feature or request label Jan 6, 2025
@wlsanderson
Copy link
Contributor

tested on the pi. Pins changed to 23 and 24, and I changed the code to use the built-in way to check for encoder updates, rather than using a time.sleep. The time.sleep causes the encoder to skip a point when rotating very quickly, which produces an inaccurate measurement. The built-in method can still skip points occasionally, but it is smoother. This code isn't really clean though and I can probably go back and clean it up later.

@harshil21 harshil21 deleted the branch use-uv January 9, 2025 01:12
@harshil21 harshil21 closed this Jan 9, 2025
@harshil21 harshil21 deleted the rotary-encoder branch January 9, 2025 01:13
@harshil21 harshil21 restored the rotary-encoder branch January 9, 2025 01:13
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.

4 participants