0

Neopixel do not stay on without a while loop
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Neopixel do not stay on without a while loop

by magius135 on Thu Jun 17, 2021 4:28 am

Hi,

I been trying some neopixel code on circuit playground bluefruit.

Is the below suppose to stay lighted up? What i facing on my circuit playground bluefruit is that it lights up and goes off. To keep it on i have to run it with while loop.

Is this the correct behaviour?

Running this on circuit python 6.3 on mu-editor 1.1.0b4

i have test similar code on micro:bit with mu-editor, the LED stays light up without the need for a while loop.

Code: Select all | TOGGLE FULL SIZE

import board
import neopixel

led = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=True)

led.fill((255, 0, 255))



Thanks for any advise, am quite new to this.

magius135
 
Posts: 3
Joined: Sat Jun 12, 2021 10:50 pm

Re: Neopixel do not stay on without a while loop

by blnkjns on Thu Jun 17, 2021 9:25 am

That's a CircuitPython thing, it shuts down the runtime engine when finished. If you want it to stay on, code with regular C++ in the Arduino IDE.
This script is so simple, you will grasp it in C++ as well.
Or just add a while loop doing nothing...

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: Neopixel do not stay on without a while loop

by magius135 on Thu Jun 17, 2021 9:41 am

Thanks for the response, appreciate it.

magius135
 
Posts: 3
Joined: Sat Jun 12, 2021 10:50 pm

Please be positive and constructive with your questions and comments.