Hey guys i seem to be having an issue with ColorWipe using FastLED, it literally wont wipe, all im getting from it is the whole strip setting to a color all at once, not the effect im wanting, could someone please look over my code and tell me what im doing wrong? Also the program calls for header file "Buttons.h" its included at the bottom.
for (int i = 0; i < NUM_LEDS; i++)
{
setPixel(i, red, green, blue);
}
This sets each pixel to the same colour pretty much instantaneously so you will not see a wipe effect. As a test, add a delay() after the setPixel(). This is not the best way to do what you want but may provide a clue as to what is going on.
Also add a show call after the delay.
You are setting all the LEDs before you actually show any of them. You only see a change when you call the show command.
Ok i cant use a delay because im using a pushbutton. Soon to be 2. But that would make sense im setting then all before they show. What do i need to change to fix that?
Do a show after each setPixel(). Use a delay() initially to prove what was wrong. In the longer term change to using millis() for timing after each show().
ok i did it with the delay and it works, this is what i have so far. But i need it to work using millis so i can change the colors. Little brother's request lol.
You then have to write the program as a state machine. It is a step up in complexity in code the idea is that the program runs in short little bursts. So there should be no for loops these should be replaced by code that keeps track of the loop variable and returns after just one iteration of it. This code is entered every x milliseconds depending on the speed you want it to.
I got this code to work for me but at the end when its supposed to wipe the other way to turn them off the last LED stays on and the modes wont switch anymore. But if i do a regular wipe forward it works fine. Any thoughts?