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

How it works...

A rainbow in nature is made up of seven colors: red, orange, yellow, green, blue, indigo, and violet. We store these colors' values, and their correct sequences as they appear in nature, in a list. The brightness level is set and then the fill method is called to turn off all the pixels on the board.

An infinite loop is started that contains two loops. The first inner loop will loop through each color in the rainbow and set one pixel to each color. The second inner loop will then go back to the seven pixels that were colored and turn each one off.