2517 views|0 replies

1w

Posts

25

Resources
The OP
 

Using WS2812 on ESP32-S2-Saola-1 [Copy link]

 

ESP32-S2-Saola-1 uses a WS2812 as an indicator light, which can display various colors. In earlier versions of CircuitPython, ESP32-S2 does not support WS2812, but in the latest circuitpython 6.0 beta0, WS2812 can already be used.

First, copy neopixel.py (or neopixel.mpy) in the adafruit-circuitpython-bundle-xxxx library to the lib directory of the CIRCUITPY disk, eject the disk and reconnect the USB to ensure that the system can load the neopixel library.

Then enter the following code in code.py, save and restart, and you can see the changes in WS2812 (note that you must eject the disk first)

import neopixel
import board
import time
import random

r = random.randrange

np = neopixel.NeoPixel(board.NEOPIXEL, 1)

while 1:
    np[0] = (r(30), r(30), r(30))
    time.sleep(0.02)

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list