Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- #include "RTClib.h"
- #include <FastLED.h>
- RTC_DS1307 rtc;
- #define LED_TYPE WS2811
- #define COLOR_ORDER BRG
- #define BRIGHTNESS 96
- #define FRAMES_PER_SECOND 120
- #define DATA_PIN_L1 3
- #define DATA_PIN_L2 4
- #define DATA_PIN_L3 5
- #define DATA_PIN_L4 6
- #define DATA_PIN_R1 20
- #define DATA_PIN_R2 21
- #define DATA_PIN_R3 22
- #define DATA_PIN_R4 23
- #define NUM_LEDS_L1 71
- #define NUM_LEDS_L2 82
- #define NUM_LEDS_L3 73
- #define NUM_LEDS_L4 62
- #define NUM_LEDS_R1 67
- #define NUM_LEDS_R2 76
- #define NUM_LEDS_R3 67
- #define NUM_LEDS_R4 97
- //Color Cyclon variables
- #define MGPu CRGB(0x8010ff) // Mardi Gras Purple
- #define MGGr CRGB(0x2cb004) // Green
- #define MGGo CRGB(0xff4a00) // Gold
- #define SECONDS_PER_PALETTE 600 // Variables for Palettes_changer
- CRGB leds_L1[NUM_LEDS_L1];
- CRGB leds_L2[NUM_LEDS_L2];
- CRGB leds_L3[NUM_LEDS_L3];
- CRGB leds_L4[NUM_LEDS_L4];
- CRGB leds_R1[NUM_LEDS_R1];
- CRGB leds_R2[NUM_LEDS_R2];
- CRGB leds_R3[NUM_LEDS_R3];
- CRGB leds_R4[NUM_LEDS_R4];
- // variables chases
- int16_t pos_chase_R1 = 0; //initial chase position by strips
- int16_t pos_chase_R2 = 0;
- int16_t pos_chase_R3 = 0;
- int16_t pos_chase_R4 = 0;
- int16_t pos_chase_L1 = 0;
- int16_t pos_chase_L2 = 0;
- int16_t pos_chase_L3 = 0;
- int16_t pos_chase_L4 = 0;
- int8_t deltaFoward = 1;
- int8_t deltaBackward = -1;
- uint16_t holdTimeFoward = 100; //ms
- uint16_t holdTimeBackward = 100; //ms
- // variables fade in fade out
- uint8_t hue = 0;
- uint8_t sat = 255;
- uint8_t val = 0;
- boolean fadeDirection = 1; // [1=fade up, 0=fade down]
- // Array of predefined colors
- CRGB colorArray[] = {
- CRGB::Red,
- CRGB::Grey,
- CRGB::Blue,
- CRGB(0,255,0),
- CHSV(195,255,255),
- };
- uint8_t colorPick;
- // Palette variables
- extern const TProgmemRGBGradientPalettePtr gGradientPalettes[];
- extern const uint8_t gGradientPaletteCount;
- // Current palette number from the 'playlist' of color palettes
- uint8_t gCurrentPaletteNumber = 0;
- CRGBPalette16 gCurrentPalette( CRGB::Black);
- CRGBPalette16 gTargetPalette( gGradientPalettes[0] );
- //DateTime now = rtc.now();
- //////////////////////////////////////////////// SETUP //////////////////////////////////////////////////////
- void setup () {
- delay(2000);
- Serial.begin(57600);
- Serial.println("Starting setup");//add this line for debug
- Wire.begin();
- rtc.begin();
- rtc.adjust(DateTime(2020, 10, 15, 09, 36, 00));
- FastLED.addLeds<LED_TYPE,DATA_PIN_L1,COLOR_ORDER>(leds_L1, NUM_LEDS_L1).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_L2,COLOR_ORDER>(leds_L2, NUM_LEDS_L2).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_L3,COLOR_ORDER>(leds_L3, NUM_LEDS_L3).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_L4,COLOR_ORDER>(leds_L4, NUM_LEDS_L4).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_R1,COLOR_ORDER>(leds_R1, NUM_LEDS_R1).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_R2,COLOR_ORDER>(leds_R2, NUM_LEDS_R2).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_R3,COLOR_ORDER>(leds_R3, NUM_LEDS_R3).setCorrection(TypicalLEDStrip);
- FastLED.addLeds<LED_TYPE,DATA_PIN_R4,COLOR_ORDER>(leds_R4, NUM_LEDS_R4).setCorrection(TypicalLEDStrip);
- }
- //////////////////////////////////////////////// LOOP //////////////////////////////////////////////////////
- void loop () {
- DateTime now = rtc.now();
- // 00:00:00
- if(now.hour() >= 0 && now.minute() <=30 && now.hour() < 1 ){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- // 00:30:00
- else if(now.hour() >= 0 && now.minute() >30 && now.hour() < 1){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- juggle(170);
- } }
- // 01:00:00
- else if(now.hour() >= 1 && now.minute() <=30 && now.hour() < 2){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- //confetti(40,60);
- } }
- //01:30:00
- else if(now.hour() >= 1 && now.minute() >30 && now.hour() < 2){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //02:00:00
- else if(now.hour() >= 2 && now.minute() <=30 && now.hour() < 3){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(200, 130, 3);
- } }
- //02:30:00
- else if(now.hour() >= 2 && now.minute() >30 && now.hour() < 3){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- chaseBackward(200,230);
- } }
- //03:00:00
- else if(now.hour() >= 3 && now.minute() <=30 && now.hour() < 4){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- juggle(0);
- } }
- //03:30:00
- else if(now.hour() >= 3 && now.minute() >30 && now.hour() < 4){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //04:00:00
- else if(now.hour() >= 4 && now.minute() <=30 && now.hour() < 5){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- chaseBackward(0,25);
- } }
- //04:30:00
- else if(now.hour() >= 4 && now.minute() >30 && now.hour() < 5){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- fadeBetween();
- } }
- //05:00:00
- else if(now.hour() >= 5 && now.minute() <=30 && now.hour() < 6){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(18, 50 , 2);
- } }
- //05:30:00
- else if(now.hour() >= 5 && now.minute() >30 && now.hour() < 6){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- confetti(160,180);
- } }
- //06:00:00
- else if(now.hour() >= 6 && now.minute() <=30 && now.hour() < 7){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- juggle(128);
- } }
- //06:30:00
- else if(now.hour() >= 6 && now.minute() >30 && now.hour() < 7){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //07:00:00
- else if(now.hour() >= 7 && now.minute() <=30 && now.hour() < 8){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- confetti(200,225);
- } }
- //07:30:00
- else if(now.hour() >= 7 && now.minute() >30 && now.hour() < 8){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- chaseBackward(128,158);
- } }
- //08:00:00
- else if(now.hour() >= 8 && now.minute() <30 && now.hour() < 9){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- confetti(0,30);
- } }
- //08:30:00
- else if(now.hour() >= 8 && now.minute() >30 && now.hour() < 9){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //09:00:00
- else if(now.hour() >= 9 && now.minute() <=30 && now.hour() < 10){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- confetti(0,180);
- } }
- //09:30:00
- else if(now.hour() >= 9 && now.minute() >30 && now.hour() < 10){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //10:00:00
- else if(now.hour() >= 10 && now.minute() <=30 && now.hour() < 11){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- confetti(128,150);
- } }
- //10:30:00
- else if(now.hour() >= 10 && now.minute() >30 && now.hour() < 11){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(80, 160, 3);
- } }
- //11:00:00
- else if(now.hour() >= 11 && now.minute() <=30 && now.hour() < 12){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- chaseBackward(200,230);
- } }
- //11:30:00
- else if(now.hour() >= 11 && now.minute() >30 && now.hour() < 12){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- confetti(128,134);
- } }
- //12:00:00
- else if(now.hour() >= 12 && now.minute() <=30 && now.hour() < 13){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- juggle(24);
- } }
- //12:30:00
- else if(now.hour() >= 12 && now.minute() >30 && now.hour() < 13){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //13:00:00
- else if(now.hour() >= 13 && now.minute() <=30 && now.hour() < 14){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(40, 215, 3);
- } }
- //13:30:00
- else if(now.hour() >= 13 && now.minute() >30 && now.hour() < 14){
- if (now.minute() >59 ) {
- fadeBetween();
- }
- else {
- sinelon(200);
- } }
- //14:00:00
- else if(now.hour() >= 14 && now.minute() <=30 && now.hour() < 15){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- confetti(100,125);
- } }
- //14:30:00
- else if(now.hour() >= 14 && now.minute() >30 && now.hour() < 15){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- chaseBackward(111,134);
- } }
- //15:00:00
- else if(now.hour() >= 15 && now.minute() <=30 && now.hour() < 16){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- chaseBackward(200,230);
- } }
- //15:30:00
- else if(now.hour() >= 15 && now.minute() >30 && now.hour() < 16){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //16:00:00
- else if(now.hour() >= 16 && now.minute() <=30 && now.hour() < 17){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(100, 24, 3);
- } }
- //16:30:00
- else if(now.hour() >= 16 && now.minute() >30 && now.hour() < 17){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //17:00:00
- else if(now.hour() >= 17 && now.minute() <=30 && now.hour() < 18){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- chaseBackward(114,148);
- } }
- //17:30:00
- else if(now.hour() >= 17 && now.minute() >30 && now.hour() < 18){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- fadeBetween();
- } }
- //18:00:00
- else if(now.hour() >= 18 && now.minute() <=30 && now.hour() < 19){
- if (now.minute() >29 ) {
- fadeBetween();
- }
- else {
- confetti(24,48);
- } }
- //18:30:00
- else if(now.hour() >= 18 && now.minute() >30 && now.hour() < 19){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- juggle(0);
- } }
- //19:00:00
- else if(now.hour() >= 19 && now.minute() <=30 && now.hour() < 20){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //19:30:00
- else if(now.hour() >= 19 && now.minute() >30 && now.hour() < 20){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- confetti(30,56);
- } }
- //20:00:00
- else if(now.hour() >= 20 && now.minute() <=30 && now.hour() < 21){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- chaseBackward(0,32);
- } }
- //20:30:00
- else if(now.hour() >= 20 && now.minute() >30 && now.hour() < 21){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(180, 24, 3);
- } }
- //21:00:00
- else if(now.hour() >= 21 && now.minute() <=30 && now.hour() < 22){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- fadeBetween();
- } }
- //21:30:00
- else if(now.hour() >= 21 && now.minute() >30 && now.hour() < 22){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- confetti(111,134);
- } }
- //22:00:00
- else if(now.hour() >= 22 && now.minute() <=30 && now.hour() < 23){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- juggle(234);
- } }
- //22:30:00
- else if(now.hour() >= 22 && now.minute() >30 && now.hour() < 23){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- palette_changer();
- } }
- //23:00:00
- else if(now.hour() >= 23 && now.minute() <=30 && now.hour() < 24){
- if ( now.minute() >29 ) {
- fadeBetween();
- }
- else {
- chaseBackward(200,230);
- } }
- //23:30:00
- else if(now.hour() >= 23 && now.minute() >30 && now.hour() < 24){
- if ( now.minute() >59 ) {
- fadeBetween();
- }
- else {
- sinelon_oneway(20, 24, 3);
- } }
- else {
- fillSolid(CRGB::Cyan); ///// <----------------- Change here
- }
- Serial.print(now.year(), DEC);
- Serial.print('/');
- Serial.print(now.month(), DEC);
- Serial.print('/');
- Serial.print(now.day(), DEC);
- Serial.print(' ');
- Serial.print(now.hour(), DEC);
- Serial.print(':');
- Serial.print(now.minute(), DEC);
- Serial.print(':');
- Serial.print(now.second(), DEC);
- Serial.println();
- Serial.println();
- //delay(3000);
- }
- //////////////////////////////////// FILL ALL ////////////////////////////////////
- void fillSolid (CRGB solidColor) {
- // Variable CRGB donc : CRGB::White ou CRGB::Blue
- fill_solid( leds_R1, NUM_LEDS_R1, solidColor);
- fill_solid( leds_R2, NUM_LEDS_R2, solidColor);
- fill_solid( leds_R3, NUM_LEDS_R3, solidColor);
- fill_solid( leds_R4, NUM_LEDS_R4, solidColor);
- fill_solid( leds_L1, NUM_LEDS_L1, solidColor);
- fill_solid( leds_L2, NUM_LEDS_L2, solidColor);
- fill_solid( leds_L3, NUM_LEDS_L3, solidColor);
- fill_solid( leds_L4, NUM_LEDS_L4, solidColor);
- FastLED.show();
- }
- void fadeBetween () {
- if (fadeDirection == 1) { //fade up
- EVERY_N_MILLISECONDS(1){
- fill_solid( leds_R1, NUM_LEDS_R1, CHSV(24,50,val) );
- fill_solid( leds_R2, NUM_LEDS_R2, CHSV(24,50,val) );
- fill_solid( leds_R3, NUM_LEDS_R3, CHSV(24,50,val) );
- fill_solid( leds_R4, NUM_LEDS_R4, CHSV(24,50,val) );
- fill_solid( leds_L1, NUM_LEDS_L1, CHSV(24,50,val) );
- fill_solid( leds_L2, NUM_LEDS_L2, CHSV(24,50,val) );
- fill_solid( leds_L3, NUM_LEDS_L3, CHSV(24,50,val) );
- fill_solid( leds_L4, NUM_LEDS_L4, CHSV(24,50,val) );
- val = val + 3;
- if (val == 225) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- if (fadeDirection == 0) { //fade down
- EVERY_N_MILLISECONDS(1){
- fill_solid( leds_R1, NUM_LEDS_R1, CHSV(24,255,val) );
- fill_solid( leds_R2, NUM_LEDS_R2, CHSV(24,255,val) );
- fill_solid( leds_R3, NUM_LEDS_R3, CHSV(24,255,val) );
- fill_solid( leds_R4, NUM_LEDS_R4, CHSV(24,255,val) );
- fill_solid( leds_L1, NUM_LEDS_L1, CHSV(24,255,val) );
- fill_solid( leds_L2, NUM_LEDS_L2, CHSV(24,255,val) );
- fill_solid( leds_L3, NUM_LEDS_L3, CHSV(24,255,val) );
- fill_solid( leds_L4, NUM_LEDS_L4, CHSV(24,255,val) );
- val = val - 3;
- if (val == 0) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- FastLED.show();
- }
- //////////////////////////////////// HEAD FOOT HANDS ////////////////////////////////////
- void light_Head_Foot_Hands(int color) {
- // Ajuster la couleur avec une variable de 0 a 255 CHSV
- if (fadeDirection == 1) { //fade up
- EVERY_N_MILLISECONDS(20){
- for(int dot = 29; dot < 44; dot++) { leds_R1[dot] = CHSV(color,sat,val);}
- for(int dot = 49; dot < 70; dot++) { leds_R2[dot] = CHSV(color,sat,val);}
- for(int dot = 18; dot < 26; dot++) { leds_R2[dot] = CHSV(color,sat,val);}
- for(int dot = 25; dot < 32; dot++) { leds_R3[dot] = CHSV(color,sat,val);}
- for(int dot = 50; dot < 63; dot++) { leds_R4[dot] = CHSV(color,sat,val);}
- for(int dot = 45; dot < 55; dot++) { leds_L4[dot] = CHSV(color,sat,val);}
- for(int dot = 29; dot < 47; dot++) { leds_L3[dot] = CHSV(color,sat,val);}
- for(int dot = 48; dot < 58; dot++) { leds_L2[dot] = CHSV(color,sat,val);}
- for(int dot = 33; dot < 43; dot++) { leds_L1[dot] = CHSV(color,sat,val);}
- val = val + 1;
- if (val == 255) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- if (fadeDirection == 0) { //fade down
- EVERY_N_MILLISECONDS(20){
- for(int dot = 29; dot < 39; dot++) { leds_R1[dot] = CHSV(color,sat,val);}
- for(int dot = 49; dot < 63; dot++) { leds_R2[dot] = CHSV(color,sat,val);}
- for(int dot = 18; dot < 24; dot++) { leds_R2[dot] = CHSV(color,sat,val);}
- for(int dot = 25; dot < 30; dot++) { leds_R3[dot] = CHSV(color,sat,val);}
- for(int dot = 51; dot < 61; dot++) { leds_R4[dot] = CHSV(color,sat,val);}
- for(int dot = 45; dot < 55; dot++) { leds_L4[dot] = CHSV(color,sat,val);}
- for(int dot = 29; dot < 47; dot++) { leds_L3[dot] = CHSV(color,sat,val);}
- for(int dot = 48; dot < 56; dot++) { leds_L2[dot] = CHSV(color,sat,val);}
- for(int dot = 29; dot < 36; dot++) { leds_L1[dot] = CHSV(color,sat,val);}
- val = val - 1;
- if (val == 20) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- FastLED.show();
- }
- //////////////////////////////////// CHASE BACKWARD ////////////////////////////////////
- void chaseBackward (int color1, int color2) {
- // Ajuster les 2 couleurs avec des CHSV de 0 Ã 255
- /// With pulse animation
- if (fadeDirection == 1) { //fade up
- EVERY_N_MILLISECONDS(20){
- fill_solid( leds_R1, NUM_LEDS_R1, CHSV(color2,sat,val) );
- fill_solid( leds_R2, NUM_LEDS_R2, CHSV(color1,sat,val) );
- fill_solid( leds_R3, NUM_LEDS_R3, CHSV(color2,sat,val) );
- fill_solid( leds_R4, NUM_LEDS_R4, CHSV(color1,sat,val) );
- fill_solid( leds_L1, NUM_LEDS_L1, CHSV(color2,sat,val) );
- fill_solid( leds_L2, NUM_LEDS_L2, CHSV(color1,sat,val) );
- fill_solid( leds_L3, NUM_LEDS_L3, CHSV(color2,sat,val) );
- fill_solid( leds_L4, NUM_LEDS_L4, CHSV(color1,sat,val) );
- val = val + 1;
- if (val == 255) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- if (fadeDirection == 0) { //fade down
- EVERY_N_MILLISECONDS(20){
- fill_solid( leds_R1, NUM_LEDS_R1, CHSV(color2,sat,val) );
- fill_solid( leds_R2, NUM_LEDS_R2, CHSV(color1,sat,val) );
- fill_solid( leds_R3, NUM_LEDS_R3, CHSV(color2,sat,val) );
- fill_solid( leds_R4, NUM_LEDS_R4, CHSV(color1,sat,val) );
- fill_solid( leds_L1, NUM_LEDS_L1, CHSV(color2,sat,val) );
- fill_solid( leds_L2, NUM_LEDS_L2, CHSV(color1,sat,val) );
- fill_solid( leds_L3, NUM_LEDS_L3, CHSV(color2,sat,val) );
- fill_solid( leds_L4, NUM_LEDS_L4, CHSV(color1,sat,val) );
- val = val - 1;
- if (val == 20) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- /// Chase animation
- EVERY_N_MILLISECONDS(holdTimeBackward) {
- leds_R1[pos_chase_R1] = CRGB::White;
- leds_R2[pos_chase_R2] = CRGB::White;
- leds_R3[pos_chase_R3] = CRGB::White;
- leds_R4[pos_chase_R4] = CRGB::White;
- leds_L1[pos_chase_L1] = CRGB::White;
- leds_L2[pos_chase_L2] = CRGB::White;
- leds_L3[pos_chase_L3] = CRGB::White;
- leds_L4[pos_chase_L4] = CRGB::White;
- FastLED.show();
- leds_R1[pos_chase_R1] = CRGB::Black;
- leds_R2[pos_chase_R2] = CRGB::Black;
- leds_R3[pos_chase_R3] = CRGB::Black;
- leds_R4[pos_chase_R4] = CRGB::Black;
- leds_L1[pos_chase_L1] = CRGB::Black;
- leds_L2[pos_chase_L2] = CRGB::Black;
- leds_L3[pos_chase_L3] = CRGB::Black;
- leds_L4[pos_chase_L4] = CRGB::Black;
- pos_chase_R1 = (pos_chase_R1 + deltaBackward + NUM_LEDS_R1) % NUM_LEDS_R1;
- pos_chase_R2 = (pos_chase_R2 + deltaBackward + NUM_LEDS_R2) % NUM_LEDS_R2;
- pos_chase_R3 = (pos_chase_R3 + deltaBackward + NUM_LEDS_R3) % NUM_LEDS_R3;
- pos_chase_R4 = (pos_chase_R4 + deltaBackward + NUM_LEDS_R4) % NUM_LEDS_R4;
- pos_chase_L1 = (pos_chase_L1 + deltaBackward + NUM_LEDS_L1) % NUM_LEDS_L1;
- pos_chase_L2 = (pos_chase_L2 + deltaBackward + NUM_LEDS_L2) % NUM_LEDS_L2;
- pos_chase_L3 = (pos_chase_L3 + deltaBackward + NUM_LEDS_L3) % NUM_LEDS_L3;
- pos_chase_L4 = (pos_chase_L4 + deltaBackward + NUM_LEDS_L4) % NUM_LEDS_L4;
- }
- }
- void chaseonly (int color, int timechange) {
- EVERY_N_MILLISECONDS(timechange) {
- leds_R1[pos_chase_R1] = CHSV(color,255,255);
- leds_R2[pos_chase_R2] = CHSV(color,255,255);
- leds_R3[pos_chase_R3] = CHSV(color,255,255);
- leds_R4[pos_chase_R4] = CHSV(color,255,255);
- leds_L1[pos_chase_L1] = CHSV(color,255,255);
- leds_L2[pos_chase_L2] = CHSV(color,255,255);
- leds_L3[pos_chase_L3] = CHSV(color,255,255);
- leds_L4[pos_chase_L4] = CHSV(color,255,255);
- FastLED.show();
- leds_R1[pos_chase_R1] = CRGB::Black;
- leds_R2[pos_chase_R2] = CRGB::Black;
- leds_R3[pos_chase_R3] = CRGB::Black;
- leds_R4[pos_chase_R4] = CRGB::Black;
- leds_L1[pos_chase_L1] = CRGB::Black;
- leds_L2[pos_chase_L2] = CRGB::Black;
- leds_L3[pos_chase_L3] = CRGB::Black;
- leds_L4[pos_chase_L4] = CRGB::Black;
- pos_chase_R1 = (pos_chase_R1 + deltaBackward + NUM_LEDS_R1) % NUM_LEDS_R1;
- pos_chase_R2 = (pos_chase_R2 + deltaBackward + NUM_LEDS_R2) % NUM_LEDS_R2;
- pos_chase_R3 = (pos_chase_R3 + deltaBackward + NUM_LEDS_R3) % NUM_LEDS_R3;
- pos_chase_R4 = (pos_chase_R4 + deltaBackward + NUM_LEDS_R4) % NUM_LEDS_R4;
- pos_chase_L1 = (pos_chase_L1 + deltaBackward + NUM_LEDS_L1) % NUM_LEDS_L1;
- pos_chase_L2 = (pos_chase_L2 + deltaBackward + NUM_LEDS_L2) % NUM_LEDS_L2;
- pos_chase_L3 = (pos_chase_L3 + deltaBackward + NUM_LEDS_L3) % NUM_LEDS_L3;
- pos_chase_L4 = (pos_chase_L4 + deltaBackward + NUM_LEDS_L4) % NUM_LEDS_L4;
- }
- }
- //////////////////////////////////// FADE IN FADE OUT ////////////////////////////////////
- void fadeIn_fadeOut (int color) {
- // Ajuster la couleur avec une variable de 0 Ã 255
- if (fadeDirection == 1) { //fade up
- EVERY_N_MILLISECONDS(20){
- fill_solid( leds_R1, NUM_LEDS_R1, CHSV(color,sat,val) );
- fill_solid( leds_R2, NUM_LEDS_R2, CHSV(color,sat,val) );
- fill_solid( leds_R3, NUM_LEDS_R3, CHSV(color,sat,val) );
- fill_solid( leds_R4, NUM_LEDS_R4, CHSV(color,sat,val) );
- fill_solid( leds_L1, NUM_LEDS_L1, CHSV(color,sat,val) );
- fill_solid( leds_L2, NUM_LEDS_L2, CHSV(color,sat,val) );
- fill_solid( leds_L3, NUM_LEDS_L3, CHSV(color,sat,val) );
- fill_solid( leds_L4, NUM_LEDS_L4, CHSV(color,sat,val) );
- val = val + 1;
- if (val == 255) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- if (fadeDirection == 0) { //fade down
- EVERY_N_MILLISECONDS(20){
- fill_solid( leds_R1, NUM_LEDS_R1, CHSV(color,sat,val) );
- fill_solid( leds_R2, NUM_LEDS_R2, CHSV(color,sat,val) );
- fill_solid( leds_R3, NUM_LEDS_R3, CHSV(color,sat,val) );
- fill_solid( leds_R4, NUM_LEDS_R4, CHSV(color,sat,val) );
- fill_solid( leds_L1, NUM_LEDS_L1, CHSV(color,sat,val) );
- fill_solid( leds_L2, NUM_LEDS_L2, CHSV(color,sat,val) );
- fill_solid( leds_L3, NUM_LEDS_L3, CHSV(color,sat,val) );
- fill_solid( leds_L4, NUM_LEDS_L4, CHSV(color,sat,val) );
- val = val - 1;
- if (val == 20) {
- fadeDirection = !fadeDirection; //reverse direction
- }
- }
- }
- FastLED.show();
- }
- //////////////////////////////////// CYCLON COLOR ////////////////////////////////////
- void cyclonColor() {
- ///Not working find why
- cylon(MGPu); // Purple. (Call cylon function with this color.)
- cylon(MGGr); // Green
- cylon(MGGo); // Gold
- }
- //////////////////////////////////// FADE ALL ////////////////////////////////////
- void fadeall() {
- for (int i = 0; i < NUM_LEDS_R1; i++) {leds_R1[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_R2; i++) {leds_R2[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_R3; i++) {leds_R3[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_R4; i++) {leds_R4[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_L1; i++) {leds_L1[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_L2; i++) {leds_L2[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_L3; i++) {leds_L3[i].nscale8(250);}
- for (int i = 0; i < NUM_LEDS_L4; i++) {leds_L4[i].nscale8(250);}
- }
- void cylon(CRGB streakcolor) {
- for (int i = 0; i < NUM_LEDS_R4; i++) {
- leds_R1[i] = streakcolor;
- leds_R2[i] = streakcolor;
- leds_R3[i] = streakcolor;
- leds_R4[i] = streakcolor;
- leds_L1[i] = streakcolor;
- leds_L2[i] = streakcolor;
- leds_L3[i] = streakcolor;
- leds_L4[i] = streakcolor;
- FastLED.show();
- fadeall();
- FastLED.delay(50);
- }
- for (int i = (NUM_LEDS_R4) - 1; i >= 0; i--) {
- leds_R1[i] = streakcolor;
- leds_R2[i] = streakcolor;
- leds_R3[i] = streakcolor;
- leds_R4[i] = streakcolor;
- leds_L1[i] = streakcolor;
- leds_L2[i] = streakcolor;
- leds_L3[i] = streakcolor;
- leds_L4[i] = streakcolor;
- FastLED.show();
- fadeall();
- FastLED.delay(50);
- }
- }
- //////////////////////////////////// CONFETTI ////////////////////////////////////
- void confetti(int color1, int color2)
- // Ajuster les couleurs : color1 est le point de départ de la couleur sur le CHSV et color2 est le point d'arriver
- //tout ce qui se trouve entre les 2 peut être affiché comme couleur
- {
- // Ajouter variables pour changer les couleurs random du CHSV a chaque fois que le fonction est caller
- // random colored speckles that blink in and fade smoothly
- fadeToBlackBy( leds_R1, NUM_LEDS_R1, 10);
- fadeToBlackBy( leds_R2, NUM_LEDS_R2, 10);
- fadeToBlackBy( leds_R3, NUM_LEDS_R3, 10);
- fadeToBlackBy( leds_R4, NUM_LEDS_R4, 10);
- fadeToBlackBy( leds_L1, NUM_LEDS_L1, 10);
- fadeToBlackBy( leds_L2, NUM_LEDS_L2, 10);
- fadeToBlackBy( leds_L3, NUM_LEDS_L3, 10);
- fadeToBlackBy( leds_L4, NUM_LEDS_L4, 10);
- int posR1 = random16(NUM_LEDS_R1);
- int posR2 = random16(NUM_LEDS_R2);
- int posR3 = random16(NUM_LEDS_R3);
- int posR4 = random16(NUM_LEDS_R4);
- int posL1 = random16(NUM_LEDS_L1);
- int posL2 = random16(NUM_LEDS_L2);
- int posL3 = random16(NUM_LEDS_L3);
- int posL4 = random16(NUM_LEDS_L4);
- int ran1b = random(30,255);
- int ran2b = random(30,255);
- int ran3b = random(30,255);
- int ran4b = random(30,255);
- int ran5b = random(30,255);
- int ran6b = random(30,255);
- int ran7b = random(30,255);
- int ran8b = random(30,255);
- int ran1c = random(color1,color2);
- int ran2c = random(color1,color2);
- int ran3c = random(color1,color2);
- int ran4c = random(color1,color2);
- int ran5c = random(color1,color2);
- int ran6c = random(color1,color2);
- int ran7c = random(color1,color2);
- int ran8c = random(color1,color2);
- //Add random brightness to every confetti
- leds_R1[posR1] += CHSV( ran1c, 200, ran1b);
- leds_R2[posR2] += CHSV( ran2c, 200, ran2b);
- leds_R3[posR3] += CHSV( ran3c, 200, ran3b);
- leds_R4[posR4] += CHSV( ran4c, 200, ran4b);
- leds_L1[posL1] += CHSV( ran5c, 200, ran5b);
- leds_L2[posL2] += CHSV( ran6c, 200, ran6b);
- leds_L3[posL3] += CHSV( ran7c, 200, ran7b);
- leds_L4[posL4] += CHSV( ran8c, 200, ran8b);
- FastLED.show();
- }
- //////////////////////////////////// SINELON ////////////////////////////////////
- void sinelon(int color)
- {
- int speedSin = 3;
- fadeToBlackBy( leds_R1, NUM_LEDS_R1, 20);
- fadeToBlackBy( leds_R2, NUM_LEDS_R2, 20);
- fadeToBlackBy( leds_R3, NUM_LEDS_R3, 20);
- fadeToBlackBy( leds_R4, NUM_LEDS_R4, 20);
- fadeToBlackBy( leds_L1, NUM_LEDS_L1, 20);
- fadeToBlackBy( leds_L2, NUM_LEDS_L2, 20);
- fadeToBlackBy( leds_L3, NUM_LEDS_L3, 20);
- fadeToBlackBy( leds_L4, NUM_LEDS_L4, 20);
- int posR1 = beatsin16( speedSin, 0, NUM_LEDS_R1-1 );
- int posR2 = beatsin16( speedSin, 0, NUM_LEDS_R2-1 );
- int posR3 = beatsin16( speedSin, 0, NUM_LEDS_R3-1 );
- int posR4 = beatsin16( speedSin, 0, NUM_LEDS_R4-1 );
- int posL1 = beatsin16( speedSin, 0, NUM_LEDS_L1-1 );
- int posL2 = beatsin16( speedSin, 0, NUM_LEDS_L2-1 );
- int posL3 = beatsin16( speedSin, 0, NUM_LEDS_L3-1 );
- int posL4 = beatsin16( speedSin, 0, NUM_LEDS_L4-1 );
- leds_R1[posR1] += CHSV( color, 255, 192);
- leds_R2[posR2] += CHSV( color, 255, 192);
- leds_R3[posR3] += CHSV( color, 255, 192);
- leds_R4[posR4] += CHSV( color, 255, 192);
- leds_L1[posL1] += CHSV( color, 255, 192);
- leds_L2[posL2] += CHSV( color, 255, 192);
- leds_L3[posL3] += CHSV( color, 255, 192);
- leds_L4[posL4] += CHSV( color, 255, 192);
- FastLED.show();
- }
- void sinelon_oneway(uint8_t BPM, int color, uint8_t fadeby)
- {
- // a colored dot going in one direction with fading tail
- fadeToBlackBy( leds_R1, NUM_LEDS_R1, fadeby);
- fadeToBlackBy( leds_R2, NUM_LEDS_R2, fadeby);
- fadeToBlackBy( leds_R3, NUM_LEDS_R3, fadeby);
- fadeToBlackBy( leds_R4, NUM_LEDS_R4, fadeby);
- fadeToBlackBy( leds_L1, NUM_LEDS_L1, fadeby);
- fadeToBlackBy( leds_L2, NUM_LEDS_L2, fadeby);
- fadeToBlackBy( leds_L3, NUM_LEDS_L3, fadeby);
- fadeToBlackBy( leds_L4, NUM_LEDS_L4, fadeby); //change fadeby to smaller or larger number to adjust the length of the tail.
- uint8_t u= beat8(BPM,0); //BPM will allow you to adjust the speed the dot is moving.
- uint16_t posR1=map(u,0,255,0,NUM_LEDS_R1);
- uint16_t posR2=map(u,0,255,0,NUM_LEDS_R2);
- uint16_t posR3=map(u,0,255,0,NUM_LEDS_R3);
- uint16_t posR4=map(u,0,255,0,NUM_LEDS_R4);
- uint16_t posL1=map(u,0,255,0,NUM_LEDS_L1);
- uint16_t posL2=map(u,0,255,0,NUM_LEDS_L2);
- uint16_t posL3=map(u,0,255,0,NUM_LEDS_L3);
- uint16_t posL4=map(u,0,255,0,NUM_LEDS_L4);
- leds_R1[posR1] = CHSV(color,255,200);
- leds_R2[posR2] = CHSV(color,255,200);
- leds_R3[posR3] = CHSV(color,255,200);
- leds_R4[posR4] = CHSV(color,255,200);
- leds_L1[posL1] = CHSV(color,255,200);
- leds_L2[posL2] = CHSV(color,255,200);
- leds_L3[posL3] = CHSV(color,255,200);
- leds_L4[posL4] = CHSV(color,255,200);
- FastLED.show();
- }
- //////////////////////////////////// JUGGLE ////////////////////////////////////
- void juggle(int color) {
- // Ajuster variable de couleur de 0 Ã 255
- int speedJuggle = 7;
- // eight colored dots, weaving in and out of sync with each other
- fadeToBlackBy( leds_R1, NUM_LEDS_R1, 50);
- fadeToBlackBy( leds_R2, NUM_LEDS_R2, 50);
- fadeToBlackBy( leds_R3, NUM_LEDS_R3, 50);
- fadeToBlackBy( leds_R4, NUM_LEDS_R4, 50);
- fadeToBlackBy( leds_L1, NUM_LEDS_L1, 50);
- fadeToBlackBy( leds_L2, NUM_LEDS_L2, 50);
- fadeToBlackBy( leds_L3, NUM_LEDS_L3, 50);
- fadeToBlackBy( leds_L4, NUM_LEDS_L4, 50);
- byte dothue = 0;
- for( int i = 0; i < speedJuggle; i++) {
- leds_R1[beatsin16( i+1, 0, NUM_LEDS_R1-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_R2[beatsin16( i+1, 0, NUM_LEDS_R1-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_R3[beatsin16( i+1, 0, NUM_LEDS_R3-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_R4[beatsin16( i+1, 0, NUM_LEDS_R4-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_L1[beatsin16( i+1, 0, NUM_LEDS_L1-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_L2[beatsin16( i+1, 0, NUM_LEDS_L2-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_L3[beatsin16( i+1, 0, NUM_LEDS_L3-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- for( int i = 0; i < speedJuggle; i++) {
- leds_L4[beatsin16( i+1, 0, NUM_LEDS_L4-1 )] |= CHSV(color, 255, 255);
- dothue += 32;
- }
- FastLED.show();
- }
- ///////////////////////////////////// PALETTES ///////////////////////////////////////
- void palette_changer() {
- EVERY_N_SECONDS( SECONDS_PER_PALETTE ) {
- gCurrentPaletteNumber = addmod8( gCurrentPaletteNumber, 1, gGradientPaletteCount);
- gTargetPalette = gGradientPalettes[ gCurrentPaletteNumber ];
- }
- EVERY_N_MILLISECONDS(40) {
- nblendPaletteTowardPalette( gCurrentPalette, gTargetPalette, 16);
- }
- colorwaves( leds_R1, NUM_LEDS_R1, gCurrentPalette);
- colorwaves( leds_R2, NUM_LEDS_R2, gCurrentPalette);
- colorwaves( leds_R3, NUM_LEDS_R3, gCurrentPalette);
- colorwaves( leds_R4, NUM_LEDS_R4, gCurrentPalette);
- colorwaves( leds_L1, NUM_LEDS_L1, gCurrentPalette);
- colorwaves( leds_L2, NUM_LEDS_L2, gCurrentPalette);
- colorwaves( leds_L3, NUM_LEDS_L3, gCurrentPalette);
- colorwaves( leds_L4, NUM_LEDS_L4, gCurrentPalette);
- FastLED.show();
- FastLED.delay(20);
- }
- // This function draws color waves with an ever-changing,
- // widely-varying set of parameters, using a color palette.
- void colorwaves( CRGB* ledarray, uint16_t numleds, CRGBPalette16& palette)
- {
- static uint16_t sPseudotime = 0;
- static uint16_t sLastMillis = 0;
- static uint16_t sHue16 = 0;
- uint8_t sat8 = beatsin88( 87, 220, 250);
- uint8_t brightdepth = beatsin88( 341, 96, 224);
- uint16_t brightnessthetainc16 = beatsin88( 203, (25 * 256), (40 * 256));
- uint8_t msmultiplier = beatsin88(147, 23, 60);
- uint16_t hue16 = sHue16;//gHue * 256;
- uint16_t hueinc16 = beatsin88(113, 300, 1500);
- uint16_t ms = millis();
- uint16_t deltams = ms - sLastMillis ;
- sLastMillis = ms;
- sPseudotime += deltams * msmultiplier;
- sHue16 += deltams * beatsin88( 400, 5,9);
- uint16_t brightnesstheta16 = sPseudotime;
- for( uint16_t i = 0 ; i < numleds; i++) {
- hue16 += hueinc16;
- uint8_t hue8 = hue16 / 256;
- uint16_t h16_128 = hue16 >> 7;
- if( h16_128 & 0x100) {
- hue8 = 255 - (h16_128 >> 1);
- } else {
- hue8 = h16_128 >> 1;
- }
- brightnesstheta16 += brightnessthetainc16;
- uint16_t b16 = sin16( brightnesstheta16 ) + 32768;
- uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536;
- uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536;
- bri8 += (255 - brightdepth);
- uint8_t index = hue8;
- //index = triwave8( index);
- index = scale8( index, 240);
- CRGB newcolor = ColorFromPalette( palette, index, bri8);
- uint16_t pixelnumber = i;
- pixelnumber = (numleds-1) - pixelnumber;
- nblend( ledarray[pixelnumber], newcolor, 128);
- }
- }
- // Alternate rendering function just scrolls the current palette
- // across the defined LED strip.
- void palettetest( CRGB* ledarray, uint16_t numleds, const CRGBPalette16& gCurrentPalette)
- {
- static uint8_t startindex = 0;
- startindex--;
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_R1) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_R2) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_R3) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_R4) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_L1) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_L2) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_L3) + 1, gCurrentPalette, 255, LINEARBLEND);
- fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS_L4) + 1, gCurrentPalette, 255, LINEARBLEND);
- }
- // Gradient palette "ib_jul01_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/xmas/tn/ib_jul01.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 16 bytes of program space.
- DEFINE_GRADIENT_PALETTE( ib_jul01_gp ) {
- 0, 194, 1, 1,
- 94, 1, 29, 18,
- 132, 57,131, 28,
- 255, 113, 1, 1};
- // Gradient palette "es_vintage_57_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/vintage/tn/es_vintage_57.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_vintage_57_gp ) {
- 0, 2, 1, 1,
- 53, 18, 1, 0,
- 104, 69, 29, 1,
- 153, 167,135, 10,
- 255, 46, 56, 4};
- // Gradient palette "es_vintage_01_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/vintage/tn/es_vintage_01.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 32 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_vintage_01_gp ) {
- 0, 4, 1, 1,
- 51, 16, 0, 1,
- 76, 97,104, 3,
- 101, 255,131, 19,
- 127, 67, 9, 4,
- 153, 16, 0, 1,
- 229, 4, 1, 1,
- 255, 4, 1, 1};
- // Gradient palette "es_rivendell_15_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/rivendell/tn/es_rivendell_15.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_rivendell_15_gp ) {
- 0, 1, 14, 5,
- 101, 16, 36, 14,
- 165, 56, 68, 30,
- 242, 150,156, 99,
- 255, 150,156, 99};
- // Gradient palette "rgi_15_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/rgi/tn/rgi_15.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 36 bytes of program space.
- DEFINE_GRADIENT_PALETTE( rgi_15_gp ) {
- 0, 4, 1, 31,
- 31, 55, 1, 16,
- 63, 197, 3, 7,
- 95, 59, 2, 17,
- 127, 6, 2, 34,
- 159, 39, 6, 33,
- 191, 112, 13, 32,
- 223, 56, 9, 35,
- 255, 22, 6, 38};
- // Gradient palette "retro2_16_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/retro2/tn/retro2_16.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 8 bytes of program space.
- DEFINE_GRADIENT_PALETTE( retro2_16_gp ) {
- 0, 188,135, 1,
- 255, 46, 7, 1};
- // Gradient palette "Analogous_1_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/red/tn/Analogous_1.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Analogous_1_gp ) {
- 0, 3, 0,255,
- 63, 23, 0,255,
- 127, 67, 0,255,
- 191, 142, 0, 45,
- 255, 255, 0, 0};
- // Gradient palette "es_pinksplash_08_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/pink_splash/tn/es_pinksplash_08.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_pinksplash_08_gp ) {
- 0, 126, 11,255,
- 127, 197, 1, 22,
- 175, 210,157,172,
- 221, 157, 3,112,
- 255, 157, 3,112};
- // Gradient palette "es_pinksplash_07_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/pink_splash/tn/es_pinksplash_07.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_pinksplash_07_gp ) {
- 0, 229, 1, 1,
- 61, 242, 4, 63,
- 101, 255, 12,255,
- 127, 249, 81,252,
- 153, 255, 11,235,
- 193, 244, 5, 68,
- 255, 232, 1, 5};
- // Gradient palette "Coral_reef_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/other/tn/Coral_reef.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 24 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Coral_reef_gp ) {
- 0, 40,199,197,
- 50, 10,152,155,
- 96, 1,111,120,
- 96, 43,127,162,
- 139, 10, 73,111,
- 255, 1, 34, 71};
- // Gradient palette "es_ocean_breeze_068_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/ocean_breeze/tn/es_ocean_breeze_068.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 24 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_ocean_breeze_068_gp ) {
- 0, 100,156,153,
- 51, 1, 99,137,
- 101, 1, 68, 84,
- 104, 35,142,168,
- 178, 0, 63,117,
- 255, 1, 10, 10};
- // Gradient palette "es_ocean_breeze_036_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/ocean_breeze/tn/es_ocean_breeze_036.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 16 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_ocean_breeze_036_gp ) {
- 0, 1, 6, 7,
- 89, 1, 99,111,
- 153, 144,209,255,
- 255, 0, 73, 82};
- // Gradient palette "departure_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/mjf/tn/departure.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 88 bytes of program space.
- DEFINE_GRADIENT_PALETTE( departure_gp ) {
- 0, 8, 3, 0,
- 42, 23, 7, 0,
- 63, 75, 38, 6,
- 84, 169, 99, 38,
- 106, 213,169,119,
- 116, 255,255,255,
- 138, 135,255,138,
- 148, 22,255, 24,
- 170, 0,255, 0,
- 191, 0,136, 0,
- 212, 0, 55, 0,
- 255, 0, 55, 0};
- // Gradient palette "es_landscape_64_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/landscape/tn/es_landscape_64.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 36 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_landscape_64_gp ) {
- 0, 0, 0, 0,
- 37, 2, 25, 1,
- 76, 15,115, 5,
- 127, 79,213, 1,
- 128, 126,211, 47,
- 130, 188,209,247,
- 153, 144,182,205,
- 204, 59,117,250,
- 255, 1, 37,192};
- // Gradient palette "es_landscape_33_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/landscape/tn/es_landscape_33.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 24 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_landscape_33_gp ) {
- 0, 1, 5, 0,
- 19, 32, 23, 1,
- 38, 161, 55, 1,
- 63, 229,144, 1,
- 66, 39,142, 74,
- 255, 1, 4, 1};
- // Gradient palette "rainbowsherbet_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/icecream/tn/rainbowsherbet.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( rainbowsherbet_gp ) {
- 0, 255, 33, 4,
- 43, 255, 68, 25,
- 86, 255, 7, 25,
- 127, 255, 82,103,
- 170, 255,255,242,
- 209, 42,255, 22,
- 255, 87,255, 65};
- // Gradient palette "gr65_hult_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr65_hult.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 24 bytes of program space.
- DEFINE_GRADIENT_PALETTE( gr65_hult_gp ) {
- 0, 247,176,247,
- 48, 255,136,255,
- 89, 220, 29,226,
- 160, 7, 82,178,
- 216, 1,124,109,
- 255, 1,124,109};
- // Gradient palette "gr64_hult_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr64_hult.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 32 bytes of program space.
- DEFINE_GRADIENT_PALETTE( gr64_hult_gp ) {
- 0, 1,124,109,
- 66, 1, 93, 79,
- 104, 52, 65, 1,
- 130, 115,127, 1,
- 150, 52, 65, 1,
- 201, 1, 86, 72,
- 239, 0, 55, 45,
- 255, 0, 55, 45};
- // Gradient palette "GMT_drywet_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/gmt/tn/GMT_drywet.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( GMT_drywet_gp ) {
- 0, 47, 30, 2,
- 42, 213,147, 24,
- 84, 103,219, 52,
- 127, 3,219,207,
- 170, 1, 48,214,
- 212, 1, 1,111,
- 255, 1, 7, 33};
- // Gradient palette "ib15_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/general/tn/ib15.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 24 bytes of program space.
- DEFINE_GRADIENT_PALETTE( ib15_gp ) {
- 0, 113, 91,147,
- 72, 157, 88, 78,
- 89, 208, 85, 33,
- 107, 255, 29, 11,
- 141, 137, 31, 39,
- 255, 59, 33, 89};
- // Gradient palette "Fuschia_7_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/fuschia/tn/Fuschia-7.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Fuschia_7_gp ) {
- 0, 43, 3,153,
- 63, 100, 4,103,
- 127, 188, 5, 66,
- 191, 161, 11,115,
- 255, 135, 20,182};
- // Gradient palette "es_emerald_dragon_08_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/emerald_dragon/tn/es_emerald_dragon_08.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 16 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_emerald_dragon_08_gp ) {
- 0, 97,255, 1,
- 101, 47,133, 1,
- 178, 13, 43, 1,
- 255, 2, 10, 1};
- // Gradient palette "lava_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/lava.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 52 bytes of program space.
- DEFINE_GRADIENT_PALETTE( lava_gp ) {
- 0, 0, 0, 0,
- 46, 18, 0, 0,
- 96, 113, 0, 0,
- 108, 142, 3, 1,
- 119, 175, 17, 1,
- 146, 213, 44, 2,
- 174, 255, 82, 4,
- 188, 255,115, 4,
- 202, 255,156, 4,
- 218, 255,203, 4,
- 234, 255,255, 4,
- 244, 255,255, 71,
- 255, 255,255,255};
- // Gradient palette "fire_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/fire.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( fire_gp ) {
- 0, 1, 1, 0,
- 76, 32, 5, 0,
- 146, 192, 24, 0,
- 197, 220,105, 5,
- 240, 252,255, 31,
- 250, 252,255,111,
- 255, 255,255,255};
- // Gradient palette "Colorfull_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Colorfull.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 44 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Colorfull_gp ) {
- 0, 10, 85, 5,
- 25, 29,109, 18,
- 60, 59,138, 42,
- 93, 83, 99, 52,
- 106, 110, 66, 64,
- 109, 123, 49, 65,
- 113, 139, 35, 66,
- 116, 192,117, 98,
- 124, 255,255,137,
- 168, 100,180,155,
- 255, 22,121,174};
- // Gradient palette "Magenta_Evening_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Magenta_Evening.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Magenta_Evening_gp ) {
- 0, 71, 27, 39,
- 31, 130, 11, 51,
- 63, 213, 2, 64,
- 70, 232, 1, 66,
- 76, 252, 1, 69,
- 108, 123, 2, 51,
- 255, 46, 9, 35};
- // Gradient palette "Pink_Purple_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Pink_Purple.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 44 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Pink_Purple_gp ) {
- 0, 19, 2, 39,
- 25, 26, 4, 45,
- 51, 33, 6, 52,
- 76, 68, 62,125,
- 102, 118,187,240,
- 109, 163,215,247,
- 114, 217,244,255,
- 122, 159,149,221,
- 149, 113, 78,188,
- 183, 128, 57,155,
- 255, 146, 40,123};
- // Gradient palette "Sunset_Real_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Sunset_Real.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Sunset_Real_gp ) {
- 0, 120, 0, 0,
- 22, 179, 22, 0,
- 51, 255,104, 0,
- 85, 167, 22, 18,
- 135, 100, 0,103,
- 198, 16, 0,130,
- 255, 0, 0,160};
- // Gradient palette "es_autumn_19_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/autumn/tn/es_autumn_19.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 52 bytes of program space.
- DEFINE_GRADIENT_PALETTE( es_autumn_19_gp ) {
- 0, 26, 1, 1,
- 51, 67, 4, 1,
- 84, 118, 14, 1,
- 104, 137,152, 52,
- 112, 113, 65, 1,
- 122, 133,149, 59,
- 124, 137,152, 52,
- 135, 113, 65, 1,
- 142, 139,154, 46,
- 163, 113, 13, 1,
- 204, 55, 3, 1,
- 249, 17, 1, 1,
- 255, 17, 1, 1};
- // Gradient palette "BlacK_Blue_Magenta_White_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Blue_Magenta_White.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( BlacK_Blue_Magenta_White_gp ) {
- 0, 0, 0, 0,
- 42, 0, 0, 45,
- 84, 0, 0,255,
- 127, 42, 0,255,
- 170, 255, 0,255,
- 212, 255, 55,255,
- 255, 255,255,255};
- // Gradient palette "BlacK_Magenta_Red_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Magenta_Red.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( BlacK_Magenta_Red_gp ) {
- 0, 0, 0, 0,
- 63, 42, 0, 45,
- 127, 255, 0,255,
- 191, 255, 0, 45,
- 255, 255, 0, 0};
- // Gradient palette "BlacK_Red_Magenta_Yellow_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Red_Magenta_Yellow.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 28 bytes of program space.
- DEFINE_GRADIENT_PALETTE( BlacK_Red_Magenta_Yellow_gp ) {
- 0, 0, 0, 0,
- 42, 42, 0, 0,
- 84, 255, 0, 0,
- 127, 255, 0, 45,
- 170, 255, 0,255,
- 212, 255, 55, 45,
- 255, 255,255, 0};
- // Gradient palette "Blue_Cyan_Yellow_gp", originally from
- // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/Blue_Cyan_Yellow.png.index.html
- // converted for FastLED with gammas (2.6, 2.2, 2.5)
- // Size: 20 bytes of program space.
- DEFINE_GRADIENT_PALETTE( Blue_Cyan_Yellow_gp ) {
- 0, 0, 0,255,
- 63, 0, 55,255,
- 127, 0,255,255,
- 191, 42,255, 45,
- 255, 255,255, 0};
- // Single array of defined cpt-city color palettes.
- // This will let us programmatically choose one based on
- // a number, rather than having to activate each explicitly
- // by name every time.
- // Since it is const, this array could also be moved
- // into PROGMEM to save SRAM, but for simplicity of illustration
- // we'll keep it in a regular SRAM array.
- //
- // This list of color palettes acts as a "playlist"; you can
- // add or delete, or re-arrange as you wish.
- const TProgmemRGBGradientPalettePtr gGradientPalettes[] = {
- Sunset_Real_gp,
- es_rivendell_15_gp,
- es_ocean_breeze_036_gp,
- rgi_15_gp,
- retro2_16_gp,
- Analogous_1_gp,
- es_pinksplash_08_gp,
- Coral_reef_gp,
- es_ocean_breeze_068_gp,
- es_pinksplash_07_gp,
- es_vintage_01_gp,
- departure_gp,
- es_landscape_64_gp,
- es_landscape_33_gp,
- rainbowsherbet_gp,
- gr65_hult_gp,
- gr64_hult_gp,
- GMT_drywet_gp,
- ib_jul01_gp,
- es_vintage_57_gp,
- ib15_gp,
- Fuschia_7_gp,
- es_emerald_dragon_08_gp,
- lava_gp,
- fire_gp,
- Colorfull_gp,
- Magenta_Evening_gp,
- Pink_Purple_gp,
- es_autumn_19_gp,
- BlacK_Blue_Magenta_White_gp,
- BlacK_Magenta_Red_gp,
- BlacK_Red_Magenta_Yellow_gp,
- Blue_Cyan_Yellow_gp };
- // Count of how many cpt-city gradients are defined:
- const uint8_t gGradientPaletteCount =
- sizeof( gGradientPalettes) / sizeof( TProgmemRGBGradientPalettePtr );
Add Comment
Please, Sign In to add comment