๐ŸŽ„โ›„โ„๏ธ๐ŸŽ It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! ๐ŸŽ„โ›„โ„๏ธ๐ŸŽ
0

Neopixel Functions
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Neopixel Functions

by BURevisfan on Thu Jun 13, 2019 11:33 am

At the suggestion of the forums, I'm using this method of setting up the Neopixel functions because I need to run two strips simultaneously with different function.

https://learn.adafruit.com/multi-taskin ... 3/overview

Now what I need help with... How do I write the code so the LED function only executes once.

For example, I want my Neopixels to fade from black/off to full red once and then stay at red until I tell them otherwise.

Right now with the fade function they fade up, pause, then start over
thanks,
Robert

BURevisfan
 
Posts: 9
Joined: Wed Oct 17, 2018 4:05 pm

Re: Neopixel Functions

by franklin97355 on Thu Jun 13, 2019 12:20 pm

Post the code you have so we can see where you need to make changes. Please use code tags when posting code or logs to the forums. It preserves formatting and makes it easier for everyone to read the code. Click the code button above the reply box and past your code between the tags created.

franklin97355
 
Posts: 21333
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Neopixel Functions

by adafruit_support_bill on Thu Jun 13, 2019 12:21 pm

Add a completion callback and use it to set the ActivePattern to None.
https://learn.adafruit.com/multi-taskin ... backs-11-9

adafruit_support_bill
 
Posts: 75043
Joined: Sat Feb 07, 2009 10:11 am

Re: Neopixel Functions

by BURevisfan on Thu Jun 13, 2019 12:36 pm

Thank you so much!

I forgot about the completion callbacks. That should accomplish what I need

BURevisfan
 
Posts: 9
Joined: Wed Oct 17, 2018 4:05 pm

Please be positive and constructive with your questions and comments.