上QQ阅读APP看书,第一时间看更新
How to do it...
To do this, perform the following steps:
- Run the following lines of code in the REPL:
>>> from adafruit_circuitplayground.express import cpx >>> cpx.pixels[0] = (255, 0, 0)
- Now, you should see the first NeoPixel turn red.
- When you run the following code, you should see the first NeoPixel turn green:
>>> cpx.pixels[0] = (0, 255, 0)
- When you run the following code, you should see the first NeoPixel turn blue:
>>> cpx.pixels[0] = (0, 0, 255)
- The following code should retrieve the current color value of the first NeoPixel:
>>> cpx.pixels[0] (0, 0, 255)
- Run the following code to turn off the first NeoPixel:
>>> cpx.pixels[0] = (0, 0, 0)
- Run the following code and the second NeoPixel should turn red:
>>> cpx.pixels[1] = (255, 0, 0)