Skip to content

Commit 7de9dd1

Browse files
committed
fix neopixel initialization
1 parent fbfb75e commit 7de9dd1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

PyPortal_Wakeup_Light/wake_up_light.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@
2424
MIN_BRIGHTNESS = 0
2525
MAX_BRIGHTNESS = 0.85
2626
#initialize neopixel strip
27-
strip = neopixel.NeoPixel(board.D3, 40, brightness=BRIGHTNESS)
27+
num_pixels = 30
28+
ORDER = neopixel.RGBW
29+
strip = neopixel.NeoPixel(board.D3, num_pixels, brightness=BRIGHTNESS,
30+
pixel_order=ORDER)
2831
strip.fill(0)
32+
# color of strip
33+
WHITE = (255, 255, 255, 255)
2934
# number of minutes it takes for strip to fade from min to max
3035
light_minutes = 30
3136

@@ -172,7 +177,7 @@ def displayTime():
172177
print("Starting wake up light")
173178
for i in range(light_minutes - 1):
174179
BRIGHTNESS = BRIGHTNESS + (MAX_BRIGHTNESS/light_minutes) # max 0.25, min 0.0
175-
strip.fill((255, 255, 255))
180+
strip.fill(WHITE)
176181
strip.brightness = BRIGHTNESS
177182
displayTime()
178183
time.sleep(60) # 60 for once per min

0 commit comments

Comments
 (0)