ESP32 Starter Kit
3. It is a module used to set the pin mode(control LED and buzzer for “output” mode, and read sensor module for
“input” ).
4. It is a module used to set the pin and the levels(“HIGH” and “LOW”).
5. It is a module used to set the delay time.
9.2.5 Project 2: Breathing LED
1. Description
Arduino breathing led utilizes on-board programmable PWM to output analog waveform. After powering on, LED
brightness can be adjusted through duty cycle of the waveform to eventually realize the effect of breathing led. In this
way, ambient light can be simulated by changing LED brightness over time. Also, breathing led can form a colorful
mini light to construct a tranquil and warm environment.
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.
9.2. Scratch Project 169