Introduction
Connect three Crazy Circuits NeoPixels to a Bit Board and control them with code.
We'll explore how to control a series of three RGB LEDs (also called "NeoPixels").
Tools
Video Overview
Featured Document
-
-
We'll use Maker Tape to connect the three NeoPixels to the Bit Board on a LEGO baseplate.
-
The NeoPixels need to be chained together. You'll notice the labels DI and DO on each one. These stand for Digital Input and Digital Output.
-
From the Bit Board, Pin 0 connects to the DI (center hole) of the NeoPixel on the left side. We then connect the DO from the first one to the DI of the second one, and so on...
-
Make sure you don't bridge the connection of DI and DO beneath a NeoPixel, or that will short the circuit and bypass that NeoPixel. (If one does not light up, check for this.)
-
You'll also need to connect the three NeoPixels to Ground (GND) and to 3.3v as shown.
-
You'll notice the Ground on the Bit Board (as well as the NeoPixel and other Crazy Circuits components we'll use) is color coded White.
-
The 3.3v hole on the Bit Board is labeled and is actually two holes right next to each other on the Bit Board. (There is a small line showing the connection between them.)
-
-
-
If you've never used a micro:bit before you'll want to check out this guide: Bit Board V2 Setup and Use
-
We're going to load the following code for our Three NeoPixels RGB program: https://makecode.microbit.org/_7iR1j46U5...
-
This one is pretty simple. After adding the NeoPixel(s) in the setup we clear the strip and set the brightness. Also note that we've set the number of leds to 3.
-
In our forever loop we're just setting the color for each of the three NeoPixels. We specify the location in the string of NeoPixels as well, starting at 0.
-
-
-
Once the code is loaded it should start running immediately.
-
You can power the micro:bit via the USB cable you used to load the code or you can use a battery pack plugged into the Bit Board.
-
You should see the NeoPixels light up. The left one will be red, the middle one with be green, and the right one will be blue.
-
-
-
Follow along with our recorded Live Stream!
-
You can watch the full video of us walking through this project, along with explaining and exploring the code: https://www.youtube.com/live/_pM0oZnZ9wQ...
-
