PWM is a mechanism for generating an output
signal that repeats periods between logic high and
low. We can control the duration of the high and
low signal in accordance with what we want. Duty
cycle is the percentage of high signal period and the
period of the signal, and this percentage will be
directly proportional to the average voltage
generated