Подключение ws2812B-16 к Raspberry PI 3

Схема подключения:

Установим необходимые библиотеки:

pip3 install rpi_ws281x adafruit-circuitpython-neopixel

Помигаем светодиодами:

import board
import neopixel
import time
import random
pixels = neopixel.NeoPixel(board.D18, 17)
time.sleep(5)
for n in range(16):
    pixels[n] = (255, 0, 0)
    time.sleep(0.1)
    pixels[n] = (255, 255, 0)
    time.sleep(0.1)
    pixels[n] = (255, 255, 255)
for n in range(16):
    pixels[n] = (0, 0, 0)
for n in range(10000):
    to=random.randint(0,16)
    pixels[to]=(random.randint(1,55), random.randint(1,55), random.randint(1,55))
    to=random.randint(0,16)
    pixels[to]=(0,0,0)