Question about arguments for built-in functions: Hello all.

Question about arguments for built-in functions:

Hello all. I am trying to figure out how to provide arguments for the built-in functions like fill_solid or fill_rainbow and am maybe a little ignorant about structs and pointers.

I understand that something like

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

will fill all pixels in a strip with DarkBlue and also that

fill_solid (leds, 3, CRGB::DarkBlue);

will fill the first 3 pixels with DarkBlue. How do I choose the starting pixel? Can you explain how to read the functions here http://fastled.io/docs/3.1/group___colorutils.html ? The * is a pointer, correct? How should I read fill_rainbow (struct CRGB *pFirstLED, int numToFill, uint8_t initialhue, uint8_t deltahue=5) ? The first argument (struct CRGB *pFirstLED) is where I get lost.

Thanks!

You pass a reference of the index of the LED array you want to change, along with the number of LEDs from that position ie &leds[i].

The wiki shows this particular method here!

for starting pixel: fill_solid (leds+5, 3, CRGB::DarkBlue);

(starts at pixel 5)

Well, untested, but quite sure about that. :wink: