1
SKILL
LEVEL
Ringo Educational Guide Rev04.1 ~ Plum Geek
Using Ringo’s Color Lights
#include “RingoHardware.h”
void setup(){
HardwareBegin(); //Sets all of Ringo’s I/O pins correctly
SwitchButtonToPixels(); //set shared line to control NeoPixel lights
// (it’s okay if there is more stuff below here)
}
SetPixelRGB(address,red,green,blue); //example formatting of function
You need a few lines of code in your project to tell the Arduino IDE to compile in
the super special Adafruit NeoPixel driver software. This code is already present
in the example projects, so don’t let this part scare you. The code belongs in your
main project page above the line:
void setup(){
Like this:
This include line will insert the
RingoHardware.h
file, which itself includes a special
line:
#include <Adafruit_NeoPixel.h>
By including
RingoHardware.h
, the IDE will
automatically include the
Adafruit_NeoPixel.h
file which allows Ringo to talk to his
lights.
Now we’re ready to make the lights go! You will control the lights with the function
SetPixelRGB();
Here is an example of how the function is formatted.
You’ll replace the word “address” with the address of the pixel you want to adjust.
Remember this is a number between 0 and 5. Then you’ll place a number between
0 and 255 in place of the words “red”, “green”, and “blue”. The number you use will
correspond to how bright or dim each of the three colors are.
A few setup steps...
Time for fun! Let’s Do This!