problem with w2812b

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Spikey1973
Posts: 2
Joined: Mon Aug 22, 2022 12:57 pm

problem with w2812b

Post by Spikey1973 » Wed Aug 31, 2022 2:01 pm

Hello to all,

after some small arduino projects, i am trying to do a larger project using a wemos esp32-s2 board. (aliexpress) using the micropython based circuit python.

to build the code step by step i started working on the basic outline of the code (non-finctional) and made a prototiype kindof setup where i can still disconnect my esp32 board but can use the tiny bits of code one at a time. unofrtunately the particular leds i am using have no prints on it. as all / most strips like this have a pinout of GND / DIN / VCC, i connected it this way too.

when i place my esp32 board on the prototype setup all 3 leds are white.. (is this normal)

unfortunately i can not get the most basic of codes (picked from adfruit circuitpython page, see below) , ofcouse i have the proper libraries on my board. I also checked out the naming of the pin number by these codes.

Code: Select all

import board
dir(board)

Code: Select all

import microcontroller
import board

board_pins = []
for pin in dir(microcontroller.pin):
    if isinstance(getattr(microcontroller.pin, pin), microcontroller.Pin):
        pins = []
        for alias in dir(board):
            if getattr(board, alias) is getattr(microcontroller.pin, pin):
                pins.append("board.{}".format(alias))
        if len(pins) > 0:
            board_pins.append(" ".join(pins))
for pins in sorted(board_pins):
    print(pins)
unfortunately i have no clue what to check look for, any thoughts on the issue would be much appreciated.

code:

Code: Select all

import board
import time
import neopixel

led = neopixel.NeoPixel(board.IO38, 3, brightness=0.2)

while True:
    led[0] = (255, 0, 0)
    time.sleep(0.5)
    led[1] = (0, 255, 0)
    time.sleep(0.5)
    led[2] = (0, 0, 255)
    time.sleep(0.5)

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: problem with w2812b

Post by scruss » Wed Aug 31, 2022 4:45 pm

Spikey1973 wrote:
Wed Aug 31, 2022 2:01 pm
... the micropython based circuit python.
It's probably best to ask on Adafruit's CircuitPython support forum, as the syntax and libraries are somewhat different to regular MicroPython.

Also, this forum is going away soon, so not many people are looking at it

Post Reply