From the course: Learning CircuitPython with Circuit Playground Express
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
NeoPixels advanced programming - Python Tutorial
From the course: Learning CircuitPython with Circuit Playground Express
NeoPixels advanced programming
- [Instructor] In this video, we'll learn some new CircuitPython language features, and code a more advanced NeoPixel effect. This new effect simply assigns three colors sequentially to the 10 pixels. But since three doesn't go evenly into 10, each time around the 10 NeoPixels, the colors shift by one until after the third time around the colors are back to the way they started. This is easier to program than it might seem. The basic algorithm is to first set up the colors and start at pixel zero. Then, loop getting the next color and putting it in the next pixel. We'll go to the desktop to see how to code this, but first there are a few new ideas to cover. You saw in the intro to NeoPixels that you could assign colors to variables. You can also create a list of those color variables. Once the colors are in a list, you can refer to them using their index. The first item in the list is index zero. Another nice feature of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Microcontroller principles2m 16s
-
(Locked)
The Circuit Playground Express (CPX)2m 51s
-
(Locked)
Controlling the CPX onboard LED3m 39s
-
(Locked)
More controlling the CPX onboard LED4m 11s
-
(Locked)
Meet the REPL4m 58s
-
(Locked)
NeoPixels intro5m 30s
-
(Locked)
NeoPixels programming4m 42s
-
(Locked)
NeoPixels advanced programming4m 54s
-
(Locked)
-
-
-