SunFounder ESP32 Starter Kit
(continued from previous page)
# Update the RGB LED strip display
pixels.write()
# Turn off the current pixel
pixels[i] = (0, 0, 0)
# Wait for a period of time to control the speed of the running light
time.sleep_ms(100)
• In the while loop, we use a for loop to turn on each pixel of the RGB LED strip one by one.
• First use the random.randint() function to generate a random color for the current pixel.
• Then turn on the current pixel with the random color, use the write() method of the NeoPixel object to send
the color data to the RGB LED strip to update its display
• Finally, turn off the current pixel by setting its color to (0, 0, 0), and wait for a period of time to control the speed
of the running light.
3. Sounds
3.14 3.1 Beep
This is a simple project to make an active buzzer beep quickly four times every second.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
Name ITEMS IN THIS KIT LINK
ESP32 Starter Kit 320+
You can also buy them separately from the links below.
COMPONENT INTRODUCTION PURCHASE LINK
ESP32 WROOM 32E
ESP32 Camera Extension -
Breadboard
Jumper Wires
Resistor
Buzzer -
Transistor
Available Pins
Here is a list of available pins on the ESP32 board for this project.
336 Chapter 3. For MicroPython User