Hey all! Love this group! I recently started having fun with arduino,

Hey all!
Love this group! I recently started having fun with arduino, ws2812b leds and FastLed thanks to all the tutorials out there. I’ve started a home automation project, arduino controlled with voice through android+bluetooth,

Everything works great at this stage but I can’t add a rainbow effect (color fading in general) with FastLed into my code as a “function” I can call upon like the ones I already have in the code, I’ve tried a few times from some code samples on here, but keep failing, is it possible? It’s all fairly new to me so no expert on the coding side. Any help/tips to push me into the right direction?
Thanks a ton!

Here’s a link to a more compact version of the code:
http://pastebin.com/E1AWQAxG

Wow thats really kind of you! I really appreciate posting it with a code example! I just tried it and it compiles nicely, although the rainbow doesn’t “cycle”.

If I put up the serial monitor and trigger “rainbow” over and over again the colors change, but If I call for the function and leave it be its just static, hmm, been trying to play around and test but to no success unfortunately

EDIT: if I put fill_rainbow( livingroom, MAX_NUM_LEDS, gHue, 17); in void loop() then it shows the rainbow animated and happy, but not when I call it from void rainbow() function :frowning: so is it not possible calling it on demand?

make sure you have the snippet that cycles the gHue variable. Thats what makes the rainbow ‘move’.
EVERY_N_MILLISECONDS( 20 ) { gHue++; }

Yes it’s there, but it’s still not working when called on-demand as a “function” like the other light-presets in the code, as you can see in the code on the first reply. It only works if both fill_rainbow and every_n_milliseconds are in Void loop() unfortunately :frowning:

@Emil_Besirevic

Can You post your current code to pastebin? I’ll take a look whenever it’s up but your initial paste had an empty function for rainbow :wink:

Problem solved thanks to a collegue who’s a programmer!
Here’s the fully working code, the short version of it, with some booleon action going on in there its finaly all working great! :slight_smile:
Thanks for the input and help everyone!
http://pastebin.com/RafnvxVz

Are you holding an android app for this or just using a Bluetooth terminal app?

It’s through an android app, mostly voice control