WS2811 fill_solid in blink sketch

I am trying to hard to learn how to program for the addressable ws2811, but it is super confusing. My programming skills are kindergarten level, but operable.

I want to know how to fill the whole strip with a single color.
The attached code works as expected, blinking and changing the colors of a singular specified LED (0, in the attached code) as expected

How do I make the whole strip blink at the same time?
I’ve tried

leds[fill_solid] = CRGB::XColor;

and

fill_solid( leds, NUM_LEDS, CRGB::Red);

to no avail.

v#include <FastLED.h>
#define NUM_LEDS 100
#define DATA_PIN 3
CRGB leds[NUM_LEDS];

void setup() { 
    
     FastLED.addLeds<WS2811, DATA_PIN, BRG>(leds, NUM_LEDS);
}

void loop() { 
  // Turn the LED on, then pause
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
  leds[0] = CRGB::Green;
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
  leds[0] = CRGB::Blue;
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
 leds[0] = CRGB::White;
  FastLED.show();
  delay(500);
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}
byte NUMBER_OF_LEDS = however many you have;
for (int ledNum = 0; ledNum < NUMBER_OF_LEDS; ledNum++)
{
  leds[ledNum] = CRGB::Red;
}
  FastLED.show();

Thank you! I will try that this evening.

So I can better understand, why doesn't fill_solid just work?

What happened when you tried fill_solid()? Did it compile? Show us the code.

GypsumFantastic:
What happened when you tried fill_solid()? Did it compile? Show us the code.

It gets an error on the last led[fill_solid]

#include <FastLED.h>
#define NUM_LEDS 100
#define DATA_PIN 3
CRGB leds[NUM_LEDS];

void setup() { 
    
     FastLED.addLeds<WS2811, DATA_PIN, BRG>(leds, NUM_LEDS);
}

void loop() { 
  // Turn the LED on, then pause
  leds[fill_solid] = CRGB::Red;
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
  leds[fill_solid] = CRGB::Green;
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
  leds[fill_solid] = CRGB::Blue;
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
 leds[fill_solid] = CRGB::White;
  FastLED.show();
  delay(500);
  // Now turn the LED off, then pause
  leds[fill_solid] = CRGB::Black;
  FastLED.show();
  delay(500);
}

I have removed some of the error message bc it was not relevant.

Arduino: 1.6.8 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Program Files\Arduino\libraries\FastLED-master/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003

 #    pragma message "FastLED version 3.003.003"

                     ^

C:\Users\ROBERT~1\AppData\Local\Temp\arduino_modified_sketch_817519\My_Blink_WS2811.ino: In function 'void loop()':

My_Blink_WS2811:13: error: invalid types 'CRGB [100][<unresolved overloaded function type>]' for array subscript

   leds[fill_solid] = CRGB::Red;

                  ^

My_Blink_WS2811:17: error: invalid types 'CRGB [100][<unresolved overloaded function type>]' for array subscript

   leds[fill_solid] = CRGB::Green;

                  ^

My_Blink_WS2811:21: error: invalid types 'CRGB [100][<unresolved overloaded function type>]' for array subscript

   leds[fill_solid] = CRGB::Blue;

                  ^

My_Blink_WS2811:25: error: invalid types 'CRGB [100][<unresolved overloaded function type>]' for array subscript

  leds[fill_solid] = CRGB::White;

                 ^

My_Blink_WS2811:29: error: invalid types 'CRGB [100][<unresolved overloaded function type>]' for array subscript

   leds[fill_solid] = CRGB::Black;

                  ^

Using library FastLED-master at version 3.3.3 in folder: C:\Program Files\Arduino\libraries\FastLED-master 
exit status 1
invalid types 'CRGB [100][<unresolved overloaded function type>]' for array subscript

I’ve never seen syntax like that before, with the function name in brackets: leds[fill_solid]. Where did you get it from?

What happened when you tried fill_solid()? How did you use it in the code, what errors did you get?

The syntax should look like this: fill_solid(leds, numberOfLEDs, CRGB::Red);

FastLED comes with a bunch of examples, check those out. They are examples, all delay() based, and you may as well move to using millis() for timing soon, but as examples of 'built-in' function and their syntax and usage they can be very helpful.

GypsumFantastic:
I've never seen syntax like that before, with the function name in brackets: leds[fill_solid]. Where did you get it from?

What happened when you tried fill_solid()? How did you use it in the code, what errors did you get?

The syntax should look like this: fill_solid(leds, numberOfLEDs, CRGB::Red);

I'm not sure where I found it, some random google result. There have been so many that I tried that I'm not sure. I will try your syntax and report back

Deva_Rishi:
FastLED comes with a bunch of examples, check those out. They are examples, all delay() based, and you may as well move to using millis() for timing soon, but as examples of 'built-in' function and their syntax and usage they can be very helpful.

Yes those are quite helpful but not when you don't understand some fundamentals of the language, which is where I'm at. I have been loading them, setting different values and tweaking things, and seeing the result.

Thank you!

interestingfellow:
Yes those are quite helpful but not when you don't understand some fundamentals of the language, which is where I'm at.

Then perhaps you should address that first, before trying to tackle a more complex addressable LED project. You know the saying --- "walk before you run".
There are numerous example programs packaged with the Arduino IDE to help you learn. And, of course, there are hundreds (thousands?) of tutorial and resource sites on the web.

GypsumFantastic:
I've never seen syntax like that before, with the function name in brackets: leds[fill_solid]. Where did you get it from?

What happened when you tried fill_solid()? How did you use it in the code, what errors did you get?

The syntax should look like this: fill_solid(leds, numberOfLEDs, CRGB::Red);

I got it from here

Sorry for the delay, I'm some combination of very busy and very lazy , there is no inbetween.

gfvalvo:
Then perhaps you should address that first, before trying to tackle a more complex addressable LED project. You know the saying --- "walk before you run".
There are numerous example programs packaged with the Arduino IDE to help you learn. And, of course, there are hundreds (thousands?) of tutorial and resource sites on the web.

I've programmed many pwm LED and motor projects, used asp programmers to modify my rc esc's, built my own 2.4ghz rc radio, modified and compiled my own version of opentx to do what I needed..... this is the next step for me. I've been trying, I've been reading, I've been learning.I've been trying to reverse engineer the fast led sketches and came across language that can do what I want but can't find documentation on how to use. You make it seem as though I haven't put any work in, and that is an incorrect assumption.

If you have constructive criticism then I would love to hear it, perhaps where to find out more about solid:fill or what documentation I could read that would show me a way to fill all the LEDs solid.
Otherwise you're just being rude and unhelpful

I got it from here

Look again more closely. The syntax is with () not .

See
http://fastled.io/docs/3.1/group___colorutils.html#gac84d8820fd175567ba66413dfb8bc63b

cattledog:
Look again more closely. The syntax is with () not .

See
FastLED: Color utility functions

THANKYOU!
I hadn’t noticed that, but I’ve been sitting here reading through fast led documentation, trying various things out to see what I did wrong. That was it.

I did end up creating a basic sketch from scratch, and copypasta code from the documentation. I can now turn on the entire strip BRG solid colors. I’m now trying to figure out how to do shades of various colors/white.

#include <FastLED.h>
#define NUM_LEDS 100
#define DATA_PIN 3
CRGB leds[NUM_LEDS];

void setup() { 
    
     FastLED.addLeds<WS2811, DATA_PIN, BRG>(leds, NUM_LEDS);
}

void loop() { 
  fill_solid( leds, NUM_LEDS, CRGB::Red);
  FastLED.show();
  delay(500);
   // Turn the LED on, then pause
fill_solid( leds, NUM_LEDS, CRGB::Black);
  FastLED.show();
  delay(500);
}

I do appreciate everyone’s help here. Thank you!

interestingfellow:
If you have constructive criticism then I would love to hear it

My suggestion was based solely on what you said in Reply #7:

Yes those are quite helpful but not when you don't understand some fundamentals of the language, which is where I'm at.

If that's the case, then my suggestion was appropriate and constructive.

Now, you claim to have programming experience. Fine, I stand corrected (the glaring problems with the code you posted not withstanding).

Now that @cattledog has provided the link to FastLED documentation (which also happens to be the first hit on a Google search), you should be all set.