SunFounder ESP32 Starter Kit
3. Set the initial state
When the button3 sprite is clicked, switch the costume to button-b (clicked state), and set the initial value of the
variable pwm to 0.
• [set pwm to 0]: from Variables palette, used to set the value of the variable.
4. Make the LED brighter and brighter
Since the range of pwm is 255, so by [repeat] block, the variable pwm is accumulated to 255 by 5, and then put into
[set PWM pin] block, so you can see the LED slowly light up.
• [change pwm by 5]: from Variables palette, let the variable change a specific number each time. It can be a
positive or negative number, positive is increasing each time, negative is decreasing each time, for example, here
the variable pwm is increased by 5 each time.
• [set PWM pin]: from the ESP32 palette, used to set the output value of the pwm pin.
4.5. 2.2 Breathing LED 481