jandelgado / jled

Non-blocking LED controlling library for Arduino and friends.
MIT License
324 stars 51 forks source link

Change PWM base frequency #96

Closed ghost closed 1 year ago

ghost commented 2 years ago

Is it possible to change the base frequency of the PWM? For a specific application I need to use a PWM with a base frequency of about 11800 Hz. I'm using an Arduino Leonardo board.

jandelgado commented 2 years ago

For the Arduino platform it is not supported currently, because the underlying Arduino API used does not support it. The ESP32 platform allows to set a custom frequency.

But for a workaround, look for example here or here on how to change the PWM frequency when using an Arduino. This could be done in initially in the setup function. But be aware to NOT change the frequency of timers affecting the millis function, because that could probably have an effect on JLed and other libraries.

jandelgado commented 2 years ago

@Mark-81, is the question answered?

ghost commented 2 years ago

Yes, thanks!

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days