Trying to figure out how to convert a NeoPixel code to FastLED.

Trying to figure out how to convert a NeoPixel code to FastLED. This line is killing me.

strip.setPixelColor(length-i-1, half_array[i]);

What would be the equivalent in FastLED?

Can post the whole code if it’d help.

leds [length-i-1] = half_array[i];
FastLED.show();

In general, where the Adafruit code uses
strip.setPixelColor( position, color);
the FastLED equivalent is
leds[ position ] = color;

There are all sorts of other details that are different, but where they use a function call to setPixelColor, we let you directly set values in the led array.

I keep having half a mind to add
FastLED.setPixelColor( pos, color);
as an API call, but so far there are still a pretty good number of reasons why we don’t do it that way. As it is, it’s pretty easy to convert the code to the new direct-access way.

Speaking as someone who is undertaking the exact same conversion task, I favor the direct -access method. The code is cleaner. Position is the array index and color is the value.