- MicroPython Cookbook
- Marwan Alsabbagh
- 71字
- 2021-06-24 14:28:04
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