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

Improve Rotary Encoder #631

Merged
merged 2 commits into from
May 16, 2024
Merged

Improve Rotary Encoder #631

merged 2 commits into from
May 16, 2024

Conversation

NemesisXB
Copy link
Contributor

Improve rotary "tick". Misses less ticks.

Add Acceleration for rotary encoder with the following functions to enable or disable acceleration. The larger the Coefficient, the faster the acceleration.

esp_err_t rotary_encoder_enable_acceleration(rotary_encoder_t *re, uint16_t coeff)

esp_err_t rotary_encoder_disable_acceleration(rotary_encoder_t *re)

Added 2 configurable time variables to Kconfig:

	config RE_ACCELERATION_MIN_CUTOFF
		int "Minimum Acceleration cutoff time (ms)"
		default 200
		help
            At this time in milliseconds between rotary ticks we want to be at the minimum acceleration

	config RE_ACCELERATION_MAX_CUTOFF
		int "Maximum Acceleration cutoff time (ms)"
		default 4
		help
            At this time in milliseconds between rotary ticks we want to be at the maximum acceleration

to determine at what time interval between "ticks" we are accelerating at the fastest and at which the slowest. In between the value is interpolated.

Add Acceleration for rotary encoder.
Update documentation of rotary_encoder_enable_acceleration and rotary_encoder_disable_acceleration functions
@UncleRus
Copy link
Owner

Great addition! Thank you!

@UncleRus UncleRus merged commit c6c2e0e into UncleRus:master May 16, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants