Last active
September 22, 2021 07:03
-
-
Save BenjaminSantiago/001febdb5e9f00e61dc68701e0bb75c5 to your computer and use it in GitHub Desktop.
make it so the neopixels light up and turn off in a sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
make it so the pixels turn on and off in sequence | |
""" | |
# our imports | |
# ------------------------------------------- | |
from adafruit_circuitplayground import cp | |
import time | |
# ------------------------------------------- | |
# global vars | |
# ------------------------------------------- | |
cp.pixels.brightness = .2 | |
sleep_time = 0.07 | |
# ------------------------------------------- | |
# main loop | |
# ------------------------------------------- | |
while True: | |
for p in range(0, 10): | |
cp.pixels[p] = (255, 0, 255) | |
time.sleep(sleep_time) | |
for p in range(0, 10): | |
cp.pixels[p] = (0, 0, 0) | |
time.sleep(sleep_time) | |
# ------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment