Adafruit Neopixel Library - Velleman VM207 User Manual

64 led rgb matrix
Table of Contents

Advertisement

Adafruit neopixel library

First we will explain the ADAFRUIT NEOPIXEL library. This library written by Adafruit can control a whole bunch
of WS2812 LEDs seperatly. So this isn't exactly useful when you want to draw text or shapes on your panel but
it is when you want to control each LED separately and do your own thing with it.
You can download the ADAFRUIT NEOPIXEL library here:
the Download ZIP button)
Then you can install this library in your Arduino installation (place the downloaded and unpacked folder in the
libraries folder of the Arduino installation) and then start the Arduino software.
If you now go to: File > Examples > Adafruit Neopixel > simple, Arduino will open that sketch.
The top section of the file that you just opened will look like this:
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send sig-
nals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strand-
test
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
What is going on here?
Well the first part is just about including the Adafruit library.
Then #define PIN 6 tells the program that PIN equals 6 and that the datastream will come out pin 6 of the
Arduino, so if we want to change that to 13 we would have to change this line of code into: #define PIN 13
Next, we have the #define NUMPIXELS 16 line which tells the program how many LEDs are going to be
controlled. So to control 1 panel, this line should look like this: #define NUMPIXELS 64. If you have 2 panels
this should be 128, 3 panels = 192, and so on.
USER MANUAL
K8403
6
16
https://github.com/adafruit/Adafruit_NeoPixel
(press
9

Advertisement

Table of Contents
loading

Table of Contents