ESP32 Starter Kit
2. What is PWM?
PWM controls analog output via digital means, which is able to adjust duty cycle of the wave (a signal circularly shifting
between high level and low level).
For Arduino, digital ports of voltage output are LOW and HIGH, which respectively correspond to 0V and 5V. Gener-
ally, we define LOW as 0 and HIGH as 1. Arduino will output 500 signals of 0 or 1 within 1s. If they are "1", 5V will
be output. Oppositely, if they are all 0, the output will be 0V. Or if they are 010101010101. . . , the average output will
be 2.5V.
In other words, output ratio of 0 and 1 affects the voltage value, the more 0 and 1 signals are output per unit time, the
more accurate the control will be.
The GPIO34, 35, 36, and 39 of ESP32 cannot use PWM.
48
Chapter 8. Arduino Tutorial
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers