Simple code question for new user. OctoWS2811

Hi all, new to the forum.

I have a simple setup on my ART car using teensy 3.1 and 4 600 led long strips that go from the font to the back of the car. I am currently running Rainbow.ino from the OctoWS2811 library. The rainbow is going in the wrong direction. It starts from the back of the car and ends at the front. I need the rainbow to start at the front to get the effect i’m looking for. Can anyone point me in the right direction? :slight_smile:

Thank you again for the help.

The code is currently using this loop to light the strip:

    for (x=0; x < ledsPerStrip; x++) {
      for (y=0; y < 8; y++) {
        int index = (color + x + y*phaseShift/2) % 180;
        leds.setPixel(x + y*ledsPerStrip, rainbowColors[index]);
      }
    }

makeColor.ino (1.59 KB)

Rainbow.ino (3.36 KB)

    for (x=0; x < ledsPerStrip; x++) {

You could index the LEDs in the opposite order.

Would you mind showing me what that would look like? I've tried a few changes but nothing worked..

And, for the low tech solution, run the strip in the opposite direction. Maybe a little over simplified tho.

Anyone?

for (x=(ledsPerStrip-1); x >= 0; x--) {

@baraccx,

If your internet has not failed you, you should have seen several suggestions offered.

Did you not see them, or just did not like them?

If you want to refine your question, I am sure it will be considered by many helpful people on this forum.