Closed JJFourie closed 4 years ago
A library that controls a motor shouldn't change Timers but it's own, because it cause problem with another parts of the user program. User can modify timers (and I agree that probably he should do that) if he want, but it's out of scope of this library
The default Arduino PWM frequency is quite low, causing motor whine in DC motors at lower duty cycles. This can be avoided if the PWM frequency is increased (to e.g. around 20kHz), and can be done on some Arduino boards by changing the related timer frequency of the used PWM pins. There are already existing libraries (e.g. https://github.com/terryjmyers/PWM) that can do this, but it seems fit that this library can set the frequency as well.