algorithm Arduino software

PWM on any I/O Pin

PWM today is used in most forms of finite control in electronic devices. LED dimmers and DC motor speed control are two common applications for PWM.

An Arduino Uno has 14 digital I/O pins, of which just six specific pins are hardware PWM-enabled ,but in some situations it would be great to be able to use any I/O pin for PWM. This is possible using AVR timers and interrupts.