上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.brightness = 1.0 >>> cpx.pixels[0] = (255, 0, 0)
- At this point, the first pixel should be the color red with full brightness. Run the following line of code to set the brightness level to 50%:
>>> cpx.pixels.brightness = 0.5
The brightness level can be brought further down to 10% and still be comfortably visible. You can do this by running the following line of code:
>>> cpx.pixels.brightness = 0.10