296 lines
8.5 KiB
C++

////======================================================
//// NEO PIXEL LED STRIP
////======================================================
//// PUBLIC DEFINITIONS
////------------------------------------------------------
// #define BETWEEN_FADE 15
// #define FADE_RATE 15
// #define BLINK_RATE 250
// #define ColorSaturation 128
////------------------------------------------------------
//// PURE COLOR
////------------------------------------------------------
// RgbColor red(colorSaturation, 0, 0);
// RgbColor green(0, colorSaturation, 0);
// RgbColor blue(0, 0, colorSaturation);
// RgbColor white(colorSaturation);
// RgbColor black(0);
////------------------------------------------------------
//// HSL COLOR
////------------------------------------------------------
// HslColor hslRed(red);
// HslColor hslGreen(green);
// HslColor hslBlue(blue);
// HslColor hslWhite(white);
// HslColor hslBlack(black);
////------------------------------------------------------
//// Clearing The LED Strip
////------------------------------------------------------
// void LED_CLEAR()
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Clear The Strip Color
// PIXEL_STRIP.clear();
//
// // Show On LED Strip
// LED_SHOW();
// }
////------------------------------------------------------
//// DISPLAY ON STRIP
////------------------------------------------------------
// void LED_SHOW()
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Pass It To The LED Strip
// PIXEL_STRIP.show();
// }
////------------------------------------------------------
//// Set LED Brightness
////------------------------------------------------------
// void LED_SET_BRIGHTNESS(uint8_t Value)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Set The Brightness
// PIXEL_STRIP.setBrightness(Value);
// }
////------------------------------------------------------
//// Set LED Color
////------------------------------------------------------
// void LED_SET_COLOR(uint8_t R, uint8_t G, uint8_t B, uint8_t Intensity)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Set Intensity
// LED_SET_BRIGHTNESS(Intensity);
//
// // Loop
// for(int i=0; i<NUM_PIXELS; i++) {
// PIXEL_STRIP.setPixelColor(i, PIXEL_STRIP.Color(R, G, B));
// }
//
// // Show The Colors On LED Strip
// LED_SHOW();
// }
////------------------------------------------------------
//// BLINK
////------------------------------------------------------
// void LED_BLINK(uint8_t R, uint8_t G, uint8_t B, int Times)
// {
// for(int i=0; i<Times; i++)
// {
// LED_SET_COLOR(R, G, B, 255);
// delay(BLINK_RATE);
// LED_CLEAR();
// delay(BLINK_RATE);
// }
// }
////------------------------------------------------------
//// COLOR WHIPE
////------------------------------------------------------
// // Fill the dots one after the other with a color
// void LED_COLOR_WIPE(uint32_t c, uint8_t wait)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Work Loop
// for(uint16_t i=0; i<NUM_PIXELS; i++)
// {
// PIXEL_STRIP.setPixelColor(i, c);
// LED_SHOW();
// delay(wait);
// }
// }
////------------------------------------------------------
//// END GAME LIGHTING SIGNAL
////------------------------------------------------------
// // Slightly different, this makes the rainbow equally distributed throughout
// void LED_RAINBOW_CYCLE(uint8_t wait)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Loop Variables
// uint16_t i, j;
//
// // The Loop
// for(j=0; j<256*5; j++)
// {
// // 5 cycles of all colors on WHEEL
// for(i=0; i< PIXEL_STRIP.numPixels(); i++)
// {
// PIXEL_STRIP.setPixelColor(i, LED_COLOR_WHEEL(((i * 256 / PIXEL_STRIP.numPixels()) + j) & 255));
// }
//
// LED_SHOW();
// delay(wait);
// }
// }
////------------------------------------------------------
//// END GAME LIGHTING SIGNAL
////------------------------------------------------------
// // Input a value 0 to 255 to get a color value.
// // The colours are a transition r - g - b - back to r.
// uint32_t LED_COLOR_WHEEL(byte WHEELPos)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Wheel Sequance
// WHEELPos = 255 - WHEELPos;
//
// if(WHEELPos < 85)
// {
// return PIXEL_STRIP.Color(255 - WHEELPos * 3, 0, WHEELPos * 3);
// }
// if(WHEELPos < 170)
// {
// WHEELPos -= 85;
// return PIXEL_STRIP.Color(0, WHEELPos * 3, 255 - WHEELPos * 3);
// }
// WHEELPos -= 170;
// return PIXEL_STRIP.Color(WHEELPos * 3, 255 - WHEELPos * 3, 0);
// }
////------------------------------------------------------
//// Set Color Fade In
////------------------------------------------------------
// void LED_FADEIN(uint8_t R, uint8_t G, uint8_t B)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Loop For Fade
// for(int i=0; i<=255; i++)
// {
// PIXEL_STRIP.setBrightness(i);
// for(int j=0; j<NUM_PIXELS; j++)
// {
// PIXEL_STRIP.setPixelColor(j, PIXEL_STRIP.Color(R, G, B));
// }
//
// LED_SHOW();
// delay(4);
// }
// }
////------------------------------------------------------
//// Set Color Fade Out
////------------------------------------------------------
// void LED_FADEOUT(uint8_t R, uint8_t G, uint8_t B)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// // Loop For Fade Out
// for(int i=255; i>=0; i--)
// {
// PIXEL_STRIP.setBrightness(i);
// for(int j=0; j<NUM_PIXELS; j++)
// {
// PIXEL_STRIP.setPixelColor(j, PIXEL_STRIP.Color(R, G, B));
// }
//
// LED_SHOW();
// delay(4);
// }
// }
////------------------------------------------------------
//// Set LED Color Cross Fade
////------------------------------------------------------
// void LED_CROSS_FADE(uint8_t R, uint8_t G, uint8_t B, unsigned int Times)
// {
// // Make Sure Boost Is On
// BOOST_ON;
//
// for(int i=0; i<Times; i++)
// {
// LED_FADEIN(R, G, B);
// LED_FADEOUT(R, G, B);
// delay(BETWEEN_FADE);
// }
// }
////------------------------------------------------------
//// REACTION GAME START LED SIGNAL
////------------------------------------------------------
// void LED_SIGNAL_START()
// {
// // Cross Fade White Color To Get ready 3 Times
// LED_CROSS_FADE(255, 255, 255, 3);
//
// // Set Strip Color Green
// LED_SET_COLOR(0, 255, 0, 255);
// }
////------------------------------------------------------
//// REACTION GAME END SINGNAL LED SIGNAL
////------------------------------------------------------
// void LED_SIGNAL_END()
// {
// // Blink Red Twice
// LED_BLINK(255, 0, 0, 2);
//
// // Fade The Red Color To Nothing
// LED_FADEOUT(255, 0, 0);
// }
////------------------------------------------------------
//// REACTION GAME START LED CELEBRATION
////------------------------------------------------------
// void LED_SIGNAL_CELEBRATION()
// {
// // Display Rainbow Twice
// LED_RAINBOW_CYCLE(2);
//
// // Grean Light OUT
// LED_FADEOUT(0, 255, 0);
// }
////------------------------------------------------------
//// REACTION GAME RESET LED SIGNAL
////------------------------------------------------------
// void LED_SIGNAL_RESET()
// {
// // Light Bright Blue
// LED_BLINK(0, 0, 255, 2);
//
// // Wait For 1/4 Second
// delay(250);
//
// // Fade Out The Blue
// LED_SET_COLOR(0, 255, 0, 255);
//
// // Set Strip Color Green
// LED_SET_COLOR(0, 255, 0, 255);
// }
////------------------------------------------------------
//// DISPLAY BAHRAIN FLAG
////------------------------------------------------------
// void LED_BAHRAIN_FLAG()
// {
// BOOST_ON;
// LED_SET_BRIGHTNESS(255);
// LED_COLOR_WIPE(PIXEL_STRIP.Color(255, 255, 255), 30); // White
// delay(250);
// LED_COLOR_WIPE(PIXEL_STRIP.Color(255, 0, 0), 30); // Red
// delay(250);
// LED_FADEOUT(255, 0, 0);
// }
////------------------------------------------------------
//// DISPLAY COLOMBIA FLAG
////------------------------------------------------------
// void LED_COLOMBIA_FLAG()
// {
// BOOST_ON;
// LED_SET_BRIGHTNESS(255);
// LED_COLOR_WIPE(PIXEL_STRIP.Color(255, 255, 0), 30); // Yellow
// delay(250);
// LED_COLOR_WIPE(PIXEL_STRIP.Color(0, 0, 255), 30); // Blue
// delay(250);
// LED_COLOR_WIPE(PIXEL_STRIP.Color(255, 0, 0), 30); // Red
// delay(250);
// LED_FADEOUT(255, 0, 0);
// }