Skip to content

Instantly share code, notes, and snippets.

@BenjaminSantiago
Last active September 22, 2021 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenjaminSantiago/001febdb5e9f00e61dc68701e0bb75c5 to your computer and use it in GitHub Desktop.
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
"""
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