![MicroPython Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/609/36698609/b_36698609.jpg)
上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:2] = [0xFF0000, 0xFF0000]
- You should see the first two NeoPixels light up as red.
- Turn the next three pixels to green and the last five pixels to blue using the following code:
>>> cpx.pixels[2:5] = [0x00FF00] * 3
>>> cpx.pixels[5:10] = [0x0000FF] * 5