A lightweight library to control NeoPixels using an easy-to-use interface.
This library wraps around Adafruit_NeoPixel
, providing simple methods to control individual and groups of pixels with ease.
- Download the library .zip file from the latest release.
- In the Arduino IDE, go to
Sketch
>Include Library
>Add .ZIP Library...
. - Select the downloaded .zip file.
#include "MiniNeoPixels.h"
#define PIXEL_PIN 3 // input pin Neopixel is attached to
#define PIXEL_COUNT 10 // number of neopixels in strip
MiniNeoPixels pixels(PIXEL_PIN, PIXEL_COUNT);
// Add types if different than default of NEO_GRB + NEO_KHZ800
//MiniNeoPixels pixels(PIXEL_PIN, PIXEL_COUNT, NEO_RGB + NEO_KHZ800);
#define PIXEL_BRIGHTNESS 50 // a brightness value from 0 - 255
void setup() {
pixels.begin(PIXEL_BRIGHTNESS);
pixels.clear(); // off
}
void loop() {
pixels.red();
delay(1000);
pixels.all(255, 100, 0); // orange
delay(1000);
pixels.yellow();
delay(1000);
pixels.green();
delay(1000);
pixels.cyan();
delay(1000);
pixels.blue();
delay(1000);
pixels.magenta();
delay(1000);
}