- esp32 s2 Saola-1. Has a WS2812 on pin
GPIO18
Saola schematic - Feather s2 has an APA102 connected on two pins (
IO45
clock andMTDO
data). Feather s2 schematic - ESP32-S2-DevKitM-1
Has a WS2812 connected on
GPIO18
. Schematic
- APA102 micropython ref
- WS2812 neopixel micropython or maybe more applicable on esp32 alternate neopixel tutorial
import machine, time, neopixel, random
rgb_pin = machine.Pin(18)
np = neopixel.NeoPixel(rgb_pin, 1)
while True:
red = random.randint(0, 129)
green = random.randint(0, 129)
blue = random.randint(0, 129)
np[0] = (red, green, blue)
np.write()
time.sleep_ms(50)
You'll first need to download the dotstar
library adafruit_dotstar.py file into /lib
(assuming CircuitPython is already installed on the FeatherS2).
import board, time, random
# import apa102
import adafruit_dotstar
# IO45 clock and MTDO data
clock_pin = board.APA102_SCK
data_pin = board.APA102_MOSI
loop_count = 0
led_strip = adafruit_dotstar.DotStar(clock_pin, data_pin, 1)
while True:
red = random.randint(0, 129)
green = random.randint(0, 129)
blue = random.randint(0, 129)
brightness = 16
led_strip[0] = (red, green, blue, brightness)
print(loop_count)
loop_count = loop_count + 1
time.sleep(1)