62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
//====================================================================
|
|
// ADAFRUITE NEO PIXEL
|
|
//====================================================================
|
|
// INCLUDE LIBRARY
|
|
//--------------------------------------------------------------------
|
|
|
|
// Neo Pixel Library
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
|
// When setting up the NeoPixel library, we tell it how many pixels,
|
|
// and which pin to use to send signals. Note that for older NeoPixel
|
|
Adafruit_NeoPixel pixels(NUMPIXELS, NEOPIXEL, NEO_GRB + NEO_KHZ800);
|
|
|
|
//--------------------------------------------------------------------
|
|
// INITIALIZE LED STRIP OBJECT (REQUIRED)
|
|
//--------------------------------------------------------------------
|
|
|
|
void neo_init() {
|
|
BOOST_ON;
|
|
delay(5);
|
|
pixels.begin();
|
|
pixels.clear();
|
|
pixels.show();
|
|
delay(5);
|
|
BOOST_OFF;
|
|
}
|
|
|
|
//--------------------------------------------------------------------
|
|
// TURNON LED STRIP - FOR WELCOME
|
|
//--------------------------------------------------------------------
|
|
|
|
void neo_welcome() {
|
|
|
|
}
|
|
|
|
//--------------------------------------------------------------------
|
|
// TURNON LED STRIP WITH COLOR
|
|
//--------------------------------------------------------------------
|
|
|
|
void neo_color(uint8_t R, uint8_t G, uint8_t B) {
|
|
BOOST_ON;
|
|
delay(1);
|
|
pixels.clear();
|
|
for(int i=0; i<NUMPIXELS; i++)
|
|
{
|
|
pixels.setPixelColor(i, pixels.Color(R, G, B));
|
|
}
|
|
pixels.setBrightness(50);
|
|
delay(2);
|
|
pixels.show();
|
|
}
|
|
|
|
//--------------------------------------------------------------------
|
|
// TURNOFF LED STRIP
|
|
//--------------------------------------------------------------------
|
|
|
|
void neo_turnoff() {
|
|
pixels.clear();
|
|
pixels.show();
|
|
BOOST_OFF;
|
|
}
|