Hey all! Having a lot of fun learning and building! I think I’m having trouble again with referencing and the CRGB class. Either that or I still haven’t figured out how variable scoping works in C. I’m getting an error along the lines of “incompatible types in assignment of ‘void’ to ‘CRGB [14]’”. Anyone know what I did wrong?
My goal is to have patterns cycling in the background like the DemoReel sketch, then activating individual strips (or two) according to the state of a switch (PIR sensors) located near each strip. I also added some background animation for when the sensors are off. Tips for making the loop better are also welcome. Thanks in advance!
http://pastebin.com/FadPFMfN
{Using FastLED 3.1/Arduino Uno R3/Windows 7}
Hey, it helps if you include the full error, including line number. I assume the error is on lines 61, 75, 89, etc? I think those lines should just be gPatternsgCurrentPatternNumber; That’ll call the function in the gPatterns array at index gCurrentPatternNumber (confetti, rainbow, etc).
@Jason_Coon yes you are correct about the lines throwing the error. I figured people could recreate it by compiling the sketch I posted if they weren’t able to figure it out like you did.
Seems like you fixed the compile error too. When adapting DemoReel I introduced “leds = gPatterns” before including the stripIndex variable. Thanks for the help!
EDIT: compile error was fixed but the animations are not working at all (neither the background brightness change nor the pattern switches). My pastebin sketch is updated & simplified.
So turns out I jumped the gun on thinking this was solved…