Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

How do I turn the NeoPixels on and off?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How do I turn the NeoPixels on and off?

by Mwangsy on Sat Mar 21, 2020 9:43 am

I am making a program where I need the NeoPixels to remain turned off (or just outputting very low levels of light) until a specific condition is met and the NeoPixels then light up in a fading manner.

I am currently struggling to turn the pixels off at the start. I have been doing strip.setBrightness(0) in the setup() section of my code, but then I cannot fade the pixels in afterwards. Similarly, if I leave out the strip.setBrightness() statement in the setup() section it instead automatically lights them up to the max. I need a way for the NeoPixels to be off at the start but in the way that I can also alter their brightness later on.

Any suggestions would be very helpful.

Mwangsy
 
Posts: 14
Joined: Fri Mar 20, 2020 4:35 am

Re: How do I turn the NeoPixels on and off?

by mikeysklar on Sat Mar 21, 2020 2:16 pm

Hello Mwangsy,

I generally use this command to turn all neopixels off.

strip.fill((0,0,0))

https://learn.adafruit.com/adafruit-neo ... cuitpython

mikeysklar
 
Posts: 2078
Joined: Mon Aug 01, 2016 8:10 pm

Re: How do I turn the NeoPixels on and off?

by Mwangsy on Sat Mar 21, 2020 2:59 pm

This has worked for me, thanks a lot!

Mwangsy
 
Posts: 14
Joined: Fri Mar 20, 2020 4:35 am

Please be positive and constructive with your questions and comments.