Skip to content

Add function that takes frequency/duty cycle as arguments for creating PWM signals #168

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

Closed
iceananas opened this issue Oct 25, 2023 · 0 comments · Fixed by #204
Closed
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@iceananas
Copy link

Refering to https://github.com/arduino/ArduinoCore-renesas/blob/main/cores/arduino/pwm.h

the begin() function takes period and pulse length as arguments, but as unsigned integers. That means the minimal resolution is 1us. For higher frequencies, this is too rough.

Example: I want to drive a piezo at 230 KHz. My options are t=4us which is 250KHz, or t=5us which is 200KHz. Both are not close enough.

It would be helpful to have a function that takes the frequency and duty cycle as arguments. Currently the begin() function even does the conversion before it calls the api function from bsp, so it is technically not an issue.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 25, 2023
@per1234 per1234 added the conclusion: resolved Issue was resolved label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants