Skip to content

Instantly share code, notes, and snippets.

@BenjaminSantiago
Created September 22, 2021 06:34
Show Gist options
  • Save BenjaminSantiago/e63203f78992078bcb8a75eac078508f to your computer and use it in GitHub Desktop.
Save BenjaminSantiago/e63203f78992078bcb8a75eac078508f to your computer and use it in GitHub Desktop.
use the sliding switch on the CPX
"""
use the switch to turn on the neopixels
"""
# --------------------------
from adafruit_circuitplayground import cp
# --------------------------
# --------------------------
while True:
if cp.switch:
cp.pixels.fill((255,255,255))
else:
cp.pixels.fill((0, 0, 0))
# --------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment