Create code.py
Moved "import time" to the top of the code.
This commit is contained in:
parent
2823e84cf0
commit
f1cc3801f4
1 changed files with 23 additions and 0 deletions
23
PyLeap_NeoPixel_Blinky_demo/code.py
Normal file
23
PyLeap_NeoPixel_Blinky_demo/code.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import time
|
||||
import board
|
||||
import neopixel
|
||||
|
||||
|
||||
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=0.2, auto_write=False)
|
||||
PURPLE = (10, 0, 25)
|
||||
PINK = (25, 0, 10)
|
||||
OFF = (0,0,0)
|
||||
|
||||
while True:
|
||||
pixels.fill(PURPLE)
|
||||
pixels.show()
|
||||
time.sleep(0.5)
|
||||
pixels.fill(OFF)
|
||||
pixels.show()
|
||||
time.sleep(0.5)
|
||||
pixels.fill(PINK)
|
||||
pixels.show()
|
||||
time.sleep(0.5)
|
||||
pixels.fill(OFF)
|
||||
pixels.show()
|
||||
time.sleep(0.5)
|
||||
Loading…
Reference in a new issue