I’m trying to get an old LED strip that uses TM1804 working on Raspberry PI model 1.
I enabled SPI via:
sudo raspi-config
I installed BiblioPixel via:
sudo pip3 install BiblioPixel (NOTE: This took a very long time to install/compile – 1.5 hours)
sudo pip3 install pyserial --upgrade
sudo pip3 install spidev
I am trying to run a simple test program. I’m not sure the program is correct. In the end, I’m just trying to get a few LEDs to light. I have PIN 19 (MOSI) connected to the data line of the LED stip.
—BEGIN PROGRAM–
import bibliopixel
causes frame timing information to be output
bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG)
Load driver for the AllPixel
from bibliopixel.drivers.SPI import *
from bibliopixel.drivers.driver_base import *
set number of pixels & LED type here
driver = Serial(num = 10, ledtype = LEDTYPE.TM1804, device_id = 2)
driver = SPI(ledtype = LEDTYPE.TM1804, num = 10, dev=’/dev/spidev0.0’, interface=‘FILE’, spi_speed=1, c_order = ChannelOrder.RGB, gamma = bibliopixel.gamma.DEFAULT)
load the LEDStrip class
from bibliopixel.layout import *
led = Strip(driver)
load channel test animation
from bibliopixel.animation import StripChannelTest
anim = StripChannelTest(led)
try:
run the animation
anim.run()
except KeyboardInterrupt:
Ctrl+C will exit the animation and turn the LEDs offs
led.all_off()
led.update()
—END PROGRAM–
When I run this via:
python3 led.py
I get this:
ValueError: 5 is not a valid LED type.
Did I miss installing something? Does my sample program look OK?