ESP32 - Neopixel Lib - WS2812B Flickering

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
KrisRevi
Posts: 7
Joined: Wed Jul 01, 2020 6:45 pm

ESP32 - Neopixel Lib - WS2812B Flickering

Post by KrisRevi » Wed Jul 01, 2020 6:50 pm

The strip WS2812B and the board ESP32 have both been tested with C++ code no flickering and all is fine! i was playing with the idea of converting my entire C++ to micropython to try it out :) but my strip is flickering :/ i have added a 300 ohm resistor to the DIN closest to the first LED (as recommended by adafruit)! but still having flickers :/ so i belive it's the code / micropython!!

Code: Select all

import machine, neopixel, time

LedPin = 23
Num_Leds = 5

np = neopixel.NeoPixel(machine.Pin(LedPin), Num_Leds, timing=1)

brightness = 1

def wheel(offset, brightness):
    offset = 255 - offset
    if offset < 85:
        return (255 - offset * 3, 0, offset * 3, brightness)
    if offset < 170:
        offset -= 85
        return (0, offset * 3, 255 - offset * 3, brightness)
    offset -= 170
    return (offset * 3, 255 - offset * 3, 0, brightness)

def clear():
    for i = 0

while True:
    for n in range(256):
        for i in range(np.n):
            np[i] = wheel(((i * 256 // np.n) + n) & 255, brightness)
        np.write()
        time.sleep(.001)

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: ESP32 - Neopixel Lib - WS2812B Flickering

Post by mattyt » Thu Jul 02, 2020 12:25 pm

Yes, it's currently an issue with the (various) Neopixel implementations for MicroPython on the ESP32. See State of Neopixels for esp32 in May 2020? for more details.

KrisRevi
Posts: 7
Joined: Wed Jul 01, 2020 6:45 pm

Re: ESP32 - Neopixel Lib - WS2812B Flickering

Post by KrisRevi » Thu Jul 02, 2020 1:55 pm

mattyt wrote:
Thu Jul 02, 2020 12:25 pm
Yes, it's currently an issue with the (various) Neopixel implementations for MicroPython on the ESP32. See State of Neopixels for esp32 in May 2020? for more details.
is this something that will get fixed?
is it ok for me to just continue to code on ESP32 with WS2812B using mmicropython and hope it will get fixed?

Post Reply