(PWM)Pulse with Modulation is a kind of technique for getting analog output results with digital control controller used to form a square wave, a signal switched between 0 or 1 or On / Off.
[crayon-675017805ded6616455551/]
Download the sample code here > 14Core_PWM_Control
Starter #3 Pulse with modulation or PWM in Arduino