Using NeoPixels with Fadecandy
Introduction
Recently I have been tasked to create a small guide for using the NeoPixels together with the Fadecandy controller. We are going to use a single 8×8 NeoPixel board and a single Fadecandy controller.
Setup
Components
We are going to use very few components:
- 1x Adafruit NeoPixel 8×8
- 1x Fadecandy
- 4x Jumper cables (male to male)
- Header pins
- Breadboard
- Mini USB cable
- Power Supply
Soldering
This is a one time thing and I just did it to make the NeoPixels easier to use later on.
Take the header pins and put them so you have two sets of 3 pins and two sets of 2 pins.
First take the two sets of 3 pins and solder them on the back of the NeoPixel matrix so we can plug the matrix into the breadboard.
Next solder the two sets of 2 pins on the GPIO pin 0 and 7 on the Fadecandy. We are actually just going to use one of the ports (GPIO pin 0) but if we have header pins on both 0 and 7, it will be better fastened to the breadboard.
Wiring
The wiring is very simple. We have 4 jumper cables:
- 2 ground
- 1 power
- 1 input
(source: https://github.com/scanlime/fadecandy
We connect the top port (blue) on the GPIO port 0 to the DIN (input) pin on the NeoPixel matrix. The bottom port (black) to the ground pin on the NeoPixel and that’s all for connecting the NeoPixels to the Fadecandy.
We are now going to need some power. There are two options, if we are just running a single board we can use USB power. So for this we need a USB cable with header pins in one end (as seen on the picture below).
Attach the cable to the board and attach a black jumper cable from ground on the USB cable to ground on the NeoPixels, and a red jumper cable from the power on the USB cable to the 5v input on the NeoPixels.
Code
Download the Fadecandy software from their GitHub site (<a href="https://github.com/scanlime/fadecandy">link</a>) and extract it somewhere on your computer.
Open the terminal (OS X/Linux) or command line (Windows) and go to your downloaded folder.
|
|
Inside that folder we need to go to the bin folder.
|
|
Now we can run the fadecandy server depending on our platform. I’m using OS X.
|
|
Connect the fadecandy to the computer using the mini USB cable and it should now be registered.
Open up the folder called ```examples/processing/grid8x8\_dot``` and open the processing sketch ```grid8x8\_dot.pde``` with Processing. Run it and the fadecandy should have a green light on and Processing should look like this
Connect the USB power to your computer and you should now be able to move your mouse around in the Processing sketch and change the light on the NeoPixel matrix.
If you don’t have a USB cable with header pins on you can use a regular 5V ~2A power supply. Connect the ground and 5V pin from the NeoPixel matrix to the power supply and run the Processing sketch for the same result.