Hello,  I am having a hard time getting the HSV function to work.

Hello,

I am having a hard time getting the HSV function to work.

i have tried

leds[i].setHSV(0,255,255);

I would expect a bright red, but the strip doesn’t light.

if i do

leds[i].setRGB( 255, 0, 0);

i get the bright red…

I am using the latest version of FastLED, do i need to have some other library imported besides fastLED.h?

Try
leds[i] = CHSV( hue, sat, value);

That work better?

This is how I use the CHSV function:
for(byte i = 0; i < NUM_LEDS; i++){
leds[i] = CHSV(0,255,255);
}

that doesnt seem to work. Does anyone have any example code with this working?

Lots of code uses this and works fine. I’m suspecting a configuration issue.

What version of FastLED are you using? And what happens on your strip when you use that syntax? Last thing: could you post your entire code to pastebin (or similar) so we can help track down the issue?

Yes, it was was another one of those user errors…

my for loop was messed up. I had

for(byte i; i < NUM_LEDS; i++){
leds[i] = CHSV(0,255,255);
}

as soon as i changed it to

for(byte i = 0; i < NUM_LEDS; i++){
leds[i] = CHSV(0,255,255);
}

worked fine. Im new to programming, but i thought every time you declared a variable, it was set to zero?

Ah! In C and C++, the initial value of all variables is undefined, so always initialize everything.

Problems with this can wind up being security holes in production software; it even has a special designation code: CWE-457 “Use of Uninitialized Variable” http://cwe.mitre.org/data/definitions/457.html

(Not that this matters in the FastLED context, but Dan and I work together in the computer security industry, so it comes to mind automatically!)