Commit a2bf6c4a authored by Federico Meloda's avatar Federico Meloda

added led test

parent e72d50ef
#!/usr/bin/env python3
from time import sleep
from random import randint
import configparser
import zmq
import spidev
import ws2812
def get_color():
rand = randint(0, 10)
if rand < 5:
return (248, 255, 255)
elif rand == 6:
return (111, 255, 0)
elif rand == 7:
return (234, 255, 0)
elif rand == 8:
return (87, 255, 34)
else:
return (0, 213, 0)
def light_flame():
spi = spidev.SpiDev()
spi.open(1, 0)
while True:
ws2812.write2812(spi, [get_color() * 4])
sleep(0.2)
def main():
light_flame()
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment