joosteto / ws2812-spi

python routines to program the WS2812 RGB LED chips on the raspberry, using the hardware SPI MOSI.
GNU Affero General Public License v3.0
59 stars 23 forks source link

Followed instructions... did not work. #7

Open techlondonon opened 6 years ago

techlondonon commented 6 years ago

When running python code:

import spidev import ws2812 spi = spidev.SpiDev() spi.open(0,0)

write 4 WS2812's, with the following colors: red, green, blue, yellow

ws2812.write2812(spi, [[10,0,0], [0,10,0], [0,0,10], [10, 10, 0]])

I get an error on line 2:

Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124] on linux Type "copyright", "credits" or "license()" for more information.

======================== RESTART: /home/pi/ws2812.py ======================== Traceback (most recent call last): File "/home/pi/ws2812.py", line 2, in import ws2812 File "/home/pi/ws2812.py", line 4, in spi.open(0,0) FileNotFoundError: [Errno 2] No such file or directory

How do I install WS2812 library?

Sorry for the questions. I am a beginner with Raspberry Pi3 and trying to get some Addressable RGB LED's working.

Thank you, Paul