// This function generates a random palette that's a gradient // between four different colors. The first is a dim hue, the second is // a bright hue, the third is a bright pastel, and the last is // another bright hue. This gives some visual bright/dark variation // which is more interesting than just a gradient of different hues. void SetupRandomPalette() { currentPalette = CRGBPalette16( CHSV( random8(), 255, 32), CHSV( random8(), 255, 255), CHSV( random8(), 128, 255), CHSV( random8(), 255, 255)); }
// This function sets up a palette of purple and green stripes. void SetupPurpleAndGreenPalette() { CRGB purple = CHSV( HUE_PURPLE, 255, 255); CRGB green = CHSV( HUE_GREEN, 255, 255); CRGB black = CRGB::Black; currentPalette = CRGBPalette16( green, green, black, black, purple, purple, black, black, green, green, black, black, purple, purple, black, black ); }
void SetupPaletteDarkness() { CRGB MidnightBlue = CRGB:: MidnightBlue; CRGB Black = CRGB::Black; CRGB Indigo = CRGB::Indigo; CRGB DarkSlateGray = CRGB::DarkSlateGray; currentPalette = CRGBPalette16( MidnightBlue, MidnightBlue, MidnightBlue, MidnightBlue, Black, Black, Indigo, Indigo, Indigo, Indigo, Black, Black, DarkSlateGray, DarkSlateGray, DarkSlateGray, DarkSlateGray); }
void SetupPaletteNeon() { CRGB DarkTurquoise = CRGB::DarkTurquoise; CRGB HotPink = CRGB::HotPink; CRGB Navy = CRGB::Navy; CRGB Black = CRGB::Black; CRGB OrangeRed = CRGB::OrangeRed; currentPalette = CRGBPalette16( Navy, Navy, DarkTurquoise, DarkTurquoise, Black, Black, HotPink, HotPink, Black, Black, OrangeRed, OrangeRed, Black, Black, HotPink, HotPink); }
//lu's palette void SetupLuPalette() { CRGB DeepPink = CRGB::DeepPink; CRGB Coral = CRGB::Coral; CRGB DarkOrange = CRGB::DarkOrange; CRGB CornflowerBlue = CRGB::CornflowerBlue; CRGB DarkCyan = CRGB::DarkCyan; currentPalette = CRGBPalette16( DeepPink, DeepPink, Coral, Coral, DarkOrange, DarkOrange, CornflowerBlue, CornflowerBlue, DarkCyan, DarkCyan, DeepPink, DeepPink, Coral, Coral, DarkOrange, DarkOrange); }
void SetupPaletteSunrise() { CRGB OrangeRed = CRGB::OrangeRed; CRGB Orange = CRGB::Orange; CRGB Salmon = CRGB::Salmon; CRGB Pink = CRGB::Pink; CRGB MistyRose = CRGB::MistyRose; CRGB LightSkyBlue = CRGB::LightSkyBlue; currentPalette = CRGBPalette16( OrangeRed, OrangeRed, OrangeRed, OrangeRed, Orange, Orange, Salmon, Salmon, Pink, Pink, MistyRose, MistyRose, LightSkyBlue, LightSkyBlue, LightSkyBlue, LightSkyBlue); }
#include "Arduino.h" #include "segment.h" CRGBPalette16 googleColors = CRGBPalette16( 0xFF0000, 0X0000FF, 0x0000FF, 0xFF0000, 0xFF0000, 0X0000FF, 0x0000FF, 0xFF0000, 0xFF0000, 0X0000FF, 0x0000FF, 0xFF0000, 0xFF0000, 0X0000FF, 0x0000FF, 0xFF0000 ); Segment::Segment() { }; void Segment::configure(float speedHead, float speedTail, float start, float end, float dither, CRGB color) { Serial.print("Segment configured with "); Serial.print(speedHead); Serial.print(","); Serial.print(speedTail); Serial.print(","); Serial.print(start); Serial.print(","); Serial.print(end); Serial.print(","); Serial.print(dither); Serial.print(","); Serial.println(color); this->speedHead = speedHead; this->speedTail = speedTail; this->start = start; this->end = end;