File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Crickits/Make_It_Glow_With_Crickit/CPX-NeoPixels Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries
2+ #
3+ # SPDX-License-Identifier: MIT
4+
5+ # Use the 10 NeoPixels on Circuit Playground Express via the
6+ # Adafruit neopixel library
7+ import time
8+ import neopixel
9+ import board
10+
11+ # Set up the 10 Circuit Playground Express NeoPixels half bright
12+ CPX_pixels = neopixel .NeoPixel (board .NEOPIXEL , 10 , brightness = 0.5 )
13+
14+ # slowly power up via blue color
15+ for i in range (50 ):
16+ CPX_pixels .fill ((0 , 0 , i ))
17+ time .sleep (0.05 )
18+
19+ # blast off!
20+ CPX_pixels .fill ((255 , 0 , 0 ))
21+
22+ while True :
23+ # pulse effect
24+ for i in range (255 , 0 , - 5 ):
25+ CPX_pixels .fill ((i , 0 , 0 ))
26+ for i in range (0 , 255 , 5 ):
27+ CPX_pixels .fill ((i , 0 , 0 ))
You can’t perform that action at this time.
0 commit comments