MicroPython Cookbook
上QQ阅读APP看书,第一时间看更新

How to do it...

To do this, perform the following steps:

  1. Run the following lines of code in the REPL:
>>> from adafruit_circuitplayground.express import cpx
>>> cpx.red_led = True
  1. You should see the pin 13 LED turn red at this stage.
  2. Check the current state of the LED using the following code:
>>> cpx.red_led
True
  1. To turn off the LED, run the following code in the REPL:
>>> cpx.red_led = False
  1. The light of the pin 13 LED will now be switched off.