Skip to content

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

Closed
@iceananas

Description

@iceananas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions