EasyManua.ls Logo

Keyestudio Ks0428 - Page 82

Keyestudio Ks0428
247 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
82
www.keyestudio.com
PWM is a technology to obtain analog quantity through digital
method. Digital control forms a square wave, and the square wave
signal only has two states of turning on and off (that is, high or low
levels). By controlling the ratio of the duration of turning on and off,
a voltage varying from 0 to 5V can be simulated. The time turning
on(academically referred to as high level) is called pulse width, so
PWM is also called pulse width modulation.
Through the following five square waves, let’s acknowledge more
about PWM.
In the above figure, the green line represents a period, and value of
analogWrite() corresponds to a percentage which is called Duty
Cycle as well. Duty cycle implies that high-level duration is divided
by low-level duration in a cycle. From top to bottom, the duty cycle

Table of Contents