WS2812 Control

Contents

WS2812 Control#

Harness the power of WS1280 LED strips with the TouchDot S3 board. Learn how to control RGB LED strips and create dazzling lighting effects using MicroPython.

This section describes how to control WS2812 LED strips using the TouchDot S3 board. The TouchDot S3 board has a GPIO pin embebbed connected to the single WS2812 LED.

Table 12 Pin Mapping for WS2812#

PIN

GPIO ESP32-S3

DIN

45

rgb led

Fig. 19 WS2812 LED Strip#

Code Example#

Below is an example that demonstrates how to control WS1280 LED strips using the TouchDot S3 board

from machine import Pin
from neopixel import NeoPixel
np = NeoPixel(Pin(45), 1)
np[0] = (255, 128, 0) # set to red, full brightness

np.write()

Tip

for more information on the NeoPixel library, refer to the NeoPixel Library Documentation.