PWM library for Arduino uno Rev2

I am searching for a suitable PWM library compatible with the Arduino Uno Rev2 but haven't been successful so far. I initially tried using the PWM.h library, but I encountered the error: "undefined reference to 'InitTimersSafe()'. I assumed this library might be outdated or incompatible with my board since it hasn’t been updated in over five years.

Next, I attempted the AVR_PWM library, but it also seems incompatible with the Uno Rev2. The same issue occurred with the TimerOne library.

Could anyone recommend a PWM library that works with the Arduino Uno Rev2? I’m hoping to avoid diving into low-level architecture and just need a straightforward way to adjust the PWM frequency. Any help would be greatly appreciated!

The library you want is khoi-prog megaAVR_PWM.

It is available through the library manager.

1 Like

Thank you so much! I suppose I should have looked a bit deeper.