WS2811B RGB LED RPi: Unterschied zwischen den Versionen

Aus AirSpaceWatch & More
Zur Navigation springen Zur Suche springen
K
Zeile 1: Zeile 1:
 
<syntaxhighlight lang="bash" line='line'>
 
<syntaxhighlight lang="bash" line='line'>
 +
# deps: python3 -m pip install --force-reinstall adafruit-blinka rpi_ws281x adafruit-circuitpython-neopixel
 +
#
 
import time
 
import time
 
import board
 
import board

Version vom 3. Oktober 2020, 08:13 Uhr

 1 # deps: python3 -m pip install --force-reinstall adafruit-blinka rpi_ws281x adafruit-circuitpython-neopixel
 2 # 
 3 import time
 4 import board
 5 import neopixel
 6 pixels = neopixel.NeoPixel(board.D18, 4) #4 PIXEL
 7 #time.sleep(1)
 8 #pixels[0] = (200, 0, 0)
 9 #time.sleep(1)
10 while (1):
11     time.sleep(0.5)
12     for x in range(0, 4):
13         pixels[x] = (10, 10, 10)
14         time.sleep(0.2)
15     for x in range(0, 4):
16         pixels[x] = (50, 0, 0)
17         time.sleep(0.2)