Neopixels color change in a loop


I’m testing a 16-led ring of neopixels and in a while loop I’m switching colors:

import streams
from adafruit.neopixel import ledstrips as neo

num_leds = 16
led_pin = D2

leds = neo.LedStrip(led_pin, num_leds)

while True:
leds.setall(100, 255, 100)
leds.setall(100, 100, 255)

<br>It works but both on both Nucleo F401RE and Particle Photon every few loops the switching stops for a moment and some LEDs get a somewhat random color. What could be the cause of this? The LEDs seems to work fine with ESP32/Arduino neopixel code.<br><br><br>


Hi riklaunim,

We’ve tested your code in both Particle Photon and Nucleo F401RE for a wile and this problem never appeared.
Which version of the Zerynth Studio are you using? After the bad behavior, the device resets itself or continues to run the script?

You can try to change the led_pin (we test with D2 and with D6).

Let me know :slight_smile:


Version is 2.0.9. D2 is for Particle, while with Nucleo I used different one.

From what I see now it’s rather sort of electronics interference. When I moved the LED Ring with it cable away from power supply and the board it works correctly without odd colors.