Browse Source

added brightness control support, still untested

master
Fr3deric 8 years ago committed by Frederic
parent
commit
bcaa78c785
  1. 11
      blup/output.py

11
blup/output.py

@ -331,10 +331,10 @@ class BLPOutput(Output):
# #
class BlinkenbuntHDOutput(Output): class BlinkenbuntHDOutput(Output):
moduleRegexDesc = 'bbunthd' moduleRegexDesc = 'bbunthd[:BRIGHTNESS]'
moduleRegex = '^bbunthd$' moduleRegex = '^bbunthd(:(?P<brightness>\d+))?$'
def __init__(self): def __init__(self, brightness):
import neopixel import neopixel
self.w = 22 self.w = 22
self.h = 16 self.h = 16
@ -342,20 +342,19 @@ class BlinkenbuntHDOutput(Output):
LED_PIN = 13 LED_PIN = 13
LED_FREQ_HZ = 800000 LED_FREQ_HZ = 800000
LED_DMA = 5 LED_DMA = 5
LED_BRIGHTNESS = 50
LED_INVERT = False LED_INVERT = False
LED_PWM = 1 LED_PWM = 1
self.strip = neopixel.Adafruit_NeoPixel( self.strip = neopixel.Adafruit_NeoPixel(
LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT,
LED_BRIGHTNESS, LED_PWM brightness, LED_PWM
) )
self.strip.begin() self.strip.begin()
self._color_cls = neopixel.Color self._color_cls = neopixel.Color
@classmethod @classmethod
def fromRegexMatch(cls, regexMatch): def fromRegexMatch(cls, regexMatch):
return cls() return cls(brightness=regexMatch.groupdict().get('brightness', 50))
def sendFrame(self, frame): def sendFrame(self, frame):
for y in range(self.h): for y in range(self.h):

Loading…
Cancel
Save