-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathled_test_pro.py
More file actions
19 lines (16 loc) · 784 Bytes
/
led_test_pro.py
File metadata and controls
19 lines (16 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import time
from rpi_ws281x import PixelStrip, Color
# LED strip configuration:
LED_COUNT = 40 # Number of LED pixels.
LED_PIN = 12 # GPIO pin connected to the pixels (18 uses PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
LED_DMA = 10 # DMA channel to use for generating signal (try 10)
LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest
LED_INVERT = False # True to invert the signal (when using NPN transistor level shift)
LED_CHANNEL = 0 # set to '1' for GPIOs 13, 19, 41, 45 or 53
strip = PixelStrip(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
strip.begin()
for i in range(LED_COUNT):
strip.setPixelColor(i, Color(255,0,0))
strip.show()
time.sleep(0.5)