Browse Source

added brightness control support, still untested

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

Loading…
Cancel
Save