Adafruit_CircuitPython_Circ.../examples/circuitplayground_slide_switch_red_led.py
2019-06-07 15:11:11 -04:00

11 lines
334 B
Python

"""This example uses the slide switch to control the little red LED."""
from adafruit_circuitplayground.express import cpx
# This code is written to be readable versus being Pylint compliant.
# pylint: disable=simplifiable-if-statement
while True:
if cpx.switch:
cpx.red_led = True
else:
cpx.red_led = False