Skip to content

Feat pwm input update #57

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

Merged
merged 3 commits into from
May 28, 2025
Merged

Feat pwm input update #57

merged 3 commits into from
May 28, 2025

Conversation

askuric
Copy link
Member

@askuric askuric commented May 27, 2025

Update and testing of the PWM input sensor.

I've tested it on f411re nucleo on 16bit and 32bit timers. it seems to work well.

The big change:
Added the PWM frequency parameter to the constructors. The rationale is that in some cases, if the PWM frequency of is low (for example 1kHz) the timer period can be shorter than the PWM period and the overflow can happen.
So I've added a short code that updates the prescaler of the timer to make sure that the timer counter period is always longer than the PWM period (provided in the constructors).
This parameter is optional, and the defualt value is 1kHz that is quite common as far as I know. But this can be changed of course.

@runger1101001 runger1101001 added the enhancement New feature or request label May 28, 2025
@runger1101001 runger1101001 added this to the 1.0.9 milestone May 28, 2025
@runger1101001
Copy link
Member

Awesome! 😎

@runger1101001 runger1101001 merged commit e0e1db1 into dev May 28, 2025
20 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.

2 participants