EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #487 background imageLoading...
Page #487 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish