Secondary Menu

Light the First Bead on 8*8 NeoPixels Matrix With Arduino

About: ElecFreaks is an open design house founded in March 2011. Our goal is to create rapid prototypes and give small-batch manufacture solution for makers and startups. With over 50% staff as engineers and expand...
More About ElecFreaks »

Flexible 64 RGB LED 8*8 NeoPixels Matrix is colorful and easy to control. You can use the only I/O port on NeoPixels Matrix to control multiple LED lights. In this article, we are going to teach you how to turn on a light on NeoPixels panel.

Step 1: Components List:

Step 2: Major Component Introduction

Every bead on Flexible 64 RGB LED 8*8 NeoPixels Matrix consists of three colors: red, green and blue. Through controlling the power of every bead with commands, we can create all kinds of colors.

Step 3: Hardware Connection

Connect NeoPixels Matrix to port D2 on Arduino board.

Step 4: Programming

Step 1: Add Adafruit_NeoPixel Library

In order to use Adafruit_NeoPixel library, we have to put the head file of NeoPixel into the program and define LED corresponding pins.

#include <Adafruit_NeoPixel.h>

#define PIN 2

If there is no NeoPixel library in your IDE software, then you can add from "Sketch" on the top tool bar. Pull down the list of "Sketch", find "Include Library", then click "Manage Libraries" within "Include Library". It will open an interface of library management. Search "Adafruit_NeoPixel" and click "Install". You can complete this step according to the picture below.

Step 5: Programming

Step 2: NeoPixel Setting

In our program, we have to address a NeoPixel object "strip" first, then we can use it to control LED strip on the panel. In the bracket, there is three parameters. These parameters are:

Step 6: Programming

In the second row, strip.show() is not a must. The function of it is to send data to LED and display it. So we set the initial status of NeoPixel to be "Off".

Step 7: Programming

Step 4: Color Setting

Set the color of each pixel with the method below:

strip.setPixelColor(n, red, green, blue);

strip.setPixelColor(n, red, green, blue, white);

Within the function of "setPixelColor", the first parameter "n" is for LED serial number. The serial number of LED closest to micro-controller pin is 0. The following three parameters in sequence are used to describe pixel color. It separately represent the brightness level of red, green and blue. 0 is the minimum brightness and 255 is the maximum brightness. "White" in the last sequence is for optional parameter. It is only suitable for full-color LED with independent pure white light, i.e. RGBW LED.

Another pixel color setting method has 2 parameters only. You can see the format below:

strip.setPixelColor(n, LEDColor);

Within this function, "n" is for LED serial number. LEDColor is for 32-bit integer variable, which combines red, green and blue to a number. Sometimes, this can improve the effectiveness of the program. With the method below, we can converse the value of red, green and blue into 32-bit integer variable.

LEDColor = strip.Color(red, green, blue);

Step 8: Programming

Step 5: Display

Function "setPixelColor()" will not influence LED display immediately. We have to send data to LED panel. At this time, we have to use function "show()". Here is the format of this function: strip.show().

Below is the whole completed program. If you don't want to program by yourself, you can download the whole program into Arduino Uno.