This library is an update of the software PWM driver you can find here:
http://davidegironi.blogspot.it/2013/03/controlling-dc-motor-speed-and_6.html
For DC motor information please look at the above link.
This update implements also progressive start / stop features using hardware timer.
The PWM frequency have to be selected in the way that the switch frequency is much higher than the dynamics of the motor.
To avoid noise from the motor, the choosen PWM frequency is 20Khz.
So, with this one, you can drive up to 4 motors independently controlling:
- speed
- direction
- slow start / stop
Code https://sourceforge.net/projects/davidegironi/files/avr-lib/avr_lib_dcmotorpwm_02.zip/download