Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FastLED.h"
- #define NUM_LEDS 245
- #define DATA_PIN 14
- #define CLOCK_PIN 13
- byte i = 1;
- unsigned char brightness = 50;
- CRGB bottomLeds[NUM_LEDS]; // Here is our FastLED Object
- /////////////////////////////// class SolidColors //////////////////////////////////////////////////////////
- /* The class constructor takes 4 inputs. Three inputs for RGB values, and one input of a pointer to a fastLED CGRB Object Array we wish to modifiy */
- class SolidColors
- {
- public:
- SolidColors(unsigned char strip, int rLevel, int gLevel, int bLevel, CRGB *LED_Array);
- int stripNumber;
- int redLevel;
- int greenLevel;
- int blueLevel;
- void begins();
- CRGB *LED_Array;
- };
- /*///////////// Constructor /////////////////*/
- SolidColors::SolidColors(unsigned char strip, int rLevel, int gLevel, int bLevel, CRGB*LED_Array){
- stripNumber = strip;
- redLevel = rLevel;
- greenLevel = gLevel;
- blueLevel = bLevel;
- }
- /*////////// End of Constructor ///////////////*/
- void SolidColors::begins(){
- Serial.print(" Begins fired off. ");
- for(int iLed = 0; iLed < NUM_LEDS; iLed++){
- //LED_Array[iLed].r = redLevel;
- //LED_Array[iLed].g = greenLevel;
- //LED_Array[iLed].b = blueLevel;
- }
- }
- /*//////////////////////// End of class SolidColors ///////////////////////////////////////////////////////////////////////////////*/
- SolidColors PersistantColor(1,0,0,200,bottomLeds); // Here is where we institaniate an Object of class SolidColors and pass in a pointer to the FastLED CRGB Object "botomLeds".
- void setup() {
- Serial.begin(115200);
- FastLED.addLeds<SK9822, DATA_PIN, CLOCK_PIN, BGR, DATA_RATE_MHZ(10)>(bottomLeds, NUM_LEDS);
- LEDS.setBrightness(brightness);
- }
- void loop() {
- while(i==1){
- i = 0;
- PersistantColor.begins();
- Serial.print("This message should show only once.");
- FastLED.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment