Add function that takes frequency/duty cycle as arguments for creating PWM signals #168
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
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.
The text was updated successfully, but these errors were encountered: