event loop updates
This commit is contained in:
parent
46e505a1fd
commit
a7318391c4
4
light_node/event_loop.py
Normal file → Executable file
4
light_node/event_loop.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
from flask import Flask, abort, jsonify, make_response, request
|
||||
from colorsys import hsv_to_rgb
|
||||
import board
|
||||
@ -8,7 +9,7 @@ import sys
|
||||
|
||||
class Led:
|
||||
__IFACE_PIN = board.D18
|
||||
__PIXEL_COUNT = 36
|
||||
__PIXEL_COUNT = 127
|
||||
|
||||
def __init__(self, power, brightness, color_angle):
|
||||
self.power = power
|
||||
@ -16,6 +17,7 @@ class Led:
|
||||
self.color_angle = color_angle
|
||||
self.iface_pin = self.__IFACE_PIN
|
||||
self.strip = neopixel.NeoPixel(self.iface_pin, self.__PIXEL_COUNT)
|
||||
self.strip[0] = (255, 0, 0)
|
||||
|
||||
def update(self, off=False):
|
||||
rgb = self.angle_2_rgb()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user