Skip to content

Commit 2823e84

Browse files
committed
Create code.py
Created a Blink demo for our device enabled guides!
1 parent ec7298c commit 2823e84

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • PyLeap_CPB_NeoPixel_Blinky_demo
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import board
2+
import neopixel
3+
import time
4+
5+
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=0.2, auto_write=False)
6+
PURPLE = (10, 0, 25)
7+
PINK = (25, 0, 10)
8+
OFF = (0,0,0)
9+
10+
while True:
11+
pixels.fill(PURPLE)
12+
pixels.show()
13+
time.sleep(0.5)
14+
pixels.fill(OFF)
15+
pixels.show()
16+
time.sleep(0.5)
17+
pixels.fill(PINK)
18+
pixels.show()
19+
time.sleep(0.5)
20+
pixels.fill(OFF)
21+
pixels.show()
22+
time.sleep(0.5)

0 commit comments

Comments
 (0)