/ examples / circuitplayground_slide_switch.py
circuitplayground_slide_switch.py
1  """This example prints the status of the slide switch. Try moving the switch back and forth to see
2  what's printed to the serial console!"""
3  import time
4  from adafruit_circuitplayground.express import cpx
5  
6  while True:
7      print("Slide switch:", cpx.switch)
8      time.sleep(0.1)