Last active
September 22, 2021 06:08
-
-
Save BenjaminSantiago/8be96595a03b8f4b3a30b4911215246e to your computer and use it in GitHub Desktop.
Turning on all neopixels on the CPX
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
""" | |
In this example we will turn on all the neopixels in the CPX | |
""" | |
# -------------------------- | |
import time | |
from adafruit_circuitplayground import cp | |
# -------------------------- | |
# -------------------------- | |
while True: | |
# use this function to access the pixels and fill them all one color\ | |
# white | |
# fill has two parentheses, because a list of values in | |
# parenthesis is called a "tuple" | |
cp.pixels.fill((255, 255, 255)) | |
time.sleep(0.3) | |
# red | |
cp.pixels.fill((255, 0, 0)) | |
time.sleep(0.3) | |
# green | |
cp.pixels.fill((0, 255, 0)) | |
time.sleep(0.3) | |
# blue | |
cp.pixels.fill((0, 0, 255)) | |
time.sleep(0.3) | |
# purple | |
cp.pixels.fill((255, 0, 255)) | |
time.sleep(0.3) | |
# a rando color that idk what | |
# it will look like | |
cp.pixels.fill((184, 91, 32)) | |
time.sleep(0.3) | |
# -------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment