Neopixel do not stay on without a while loop

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
magius135
 
Posts: 3
Joined: Sat Jun 12, 2021 10:50 pm

Neopixel do not stay on without a while loop

Post by magius135 »

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


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.

User avatar
blnkjns
 
Posts: 963
Joined: Fri Oct 02, 2020 3:33 am

Re: Neopixel do not stay on without a while loop

Post by blnkjns »

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...

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

Re: Neopixel do not stay on without a while loop

Post by magius135 »

Thanks for the response, appreciate it.

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”