•
NeoPixel ring two: ground to microcontroller GND
•
NeoPixel ring two: V+ to microcontroller 3V
Button
•
The built-in Boot button (highlighted in magenta in the wiring diagram) is located
at the bottom left corner of the display, above the GND pin.
asyncio Example Code
Once everything is wired up, the next step is to load the example code onto your
microcontroller.
To run this example, you'll need to include a few libraries onto your CIRCUITPY drive.
Then you need to update code.py with the example code.
Thankfully, this can be done in one go. In the example below, click the Download
Project Bundle button below to download the necessary libraries and the code.py file
in a zip file. Extract the contents of the zip file, and copy the entire lib folder and the c
ode.py file to your CIRCUITPY drive.
# SPDX-FileCopyrightText: Copyright (c) 2022 Dan Halbert for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2022 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
CircuitPython asyncio example for two NeoPixel rings and one button.
"""
import asyncio
import board
import neopixel
import keypad
from rainbowio import colorwheel
button_pin = board.BUTTON
num_pixels = 16
brightness = 0.2
# Set up NeoPixel rings.
ring_one = neopixel.NeoPixel(board.A1, num_pixels, brightness=brightness,
auto_write=False)
ring_two = neopixel.NeoPixel(board.A2, num_pixels, brightness=brightness,
auto_write=False)
class AnimationControls:
"""The controls to allow you to vary the rainbow and blink animations."""
def __init__(self):
self.reverse = False
self.wait = 0.0
self.delay = 0.5
©Adafruit Industries
# The pin the button is connected to.
# The number of NeoPixels on a single ring.
# The LED brightness.
Page 183 of 263
Need help?
Do you have a question about the ESP32-S3 and is the answer not in the manual?