NEOPIXEL MATRIX NOT RESPONSIVE PYTHON FT232H

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
apaul
 
Posts: 2
Joined: Wed Jul 21, 2021 8:33 am

NEOPIXEL MATRIX NOT RESPONSIVE PYTHON FT232H

Post by apaul »

Hi,

I'm trying to control LEDs on a matrix ( https://www.adafruit.com/product/2294 , WS2812B based) using a FT232H ( https://www.adafruit.com/product/2264 ).
Although the code runs without any exception no LEDs are turned on. I've tried multiple matrices and FT232H, it seems not to be a hardware failure. Furthermore it is definitely soldered correctly and if I connect a simple LED strip it's working.

Setup:
Relevant python packages:
  • Adafruit-Blinka 6.12.0
    adafruit-circuitpython-busdevice 5.0.6
    adafruit-circuitpython-neopixel-spi 0.9.1
    adafruit-circuitpython-pypixelbuf 2.2.6
    Adafruit-PlatformDetect 3.15.3
    Adafruit-PureIO 1.1.9
    pyftdi 0.53.1

Python code:

Code: Select all

import board  # type: ignore
import neopixel_spi as neopixel  # type: ignore

NUM_PIXELS = 5
PIXEL_ORDER = neopixel.GRB

spi = board.SPI()
pixels = neopixel.NeoPixel_SPI(
        spi,
        n=NUM_PIXELS,
        brightness=0.05,
        pixel_order=PIXEL_ORDER,
)
pixels.fill(0xFFFFFF)

# Doing some stuff...

pixels.fill(0x000000)
I'd appreciate any help!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: NEOPIXEL MATRIX NOT RESPONSIVE PYTHON FT232H

Post by mikeysklar »

It looks like the example code has some issues.

Your using an RGB matrix, but it is being initialized with a GRB and only five pixels. Both of which you want to change. The last line of the code is also turning all the pixels off so you should not expect to see anything without any pause or loop.

It would probably make more sense to start with a matrix demo code and make the necessary modifications to work with the FT232H.

https://learn.adafruit.com/easy-neopixe ... -3071812-9

Code: Select all

import board
import neopixel
from adafruit_pixel_framebuf import PixelFramebuffer

pixel_pin = board.D6
pixel_width = 8
pixel_height = 4

pixels = neopixel.NeoPixel(
    pixel_pin,
    pixel_width * pixel_height,
    brightness=0.1,
    auto_write=False,
)

User avatar
apaul
 
Posts: 2
Joined: Wed Jul 21, 2021 8:33 am

Re: NEOPIXEL MATRIX NOT RESPONSIVE PYTHON FT232H

Post by apaul »

Hi, thanks for the quick reply!

I tried your code, the neopixel import fails"NotImplementedError: Board not supported" (from neopixel_write.py", line 29). I did `export BLINKA_FT232H=1` previously. For reference, that's the `lsusb` output: "Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC".
As for my previous code, I adjusted it to:

Code: Select all

import board 
import neopixel_spi as neopixel  # type: ignore

NUM_PIXELS = 256 # (Using the 8x32 matrix)
PIXEL_ORDER = neopixel.RGB

spi = board.SPI()
    pixels = neopixel.NeoPixel_SPI(
        spi,
        n=NUM_PIXELS,
        brightness=0.05,
        pixel_order=PIXEL_ORDER, 
    )
pixels.fill(0xFFFFFF)
But so far this doesn't work.

FYI:
python3.8 detect.py
Chip id: FT232H
Board id: FTDI_FT232H

Is this a DragonBoard 410c? False
Is this a Pi 3B+? False
Is this a Pi 4B? False
Is this a 40-pin Raspberry Pi? False
Is this a Raspberry Pi Compute Module? False
Is this a BeagleBone Board? False
Is this a Giant Board? False
Is this a Coral Dev Board? False
Is this a Coral Dev Board Mini? False
Is this a SiFive Unleashed? False
Is this a PYNQ Board? False
Is this a Rock Pi board? False
Is this a NanoPi board? False
Is this a Clockwork Pi board? False
Is this an embedded Linux system? False
Is this a generic Linux PC? False
Is this a UDOO Bolt? False
Is this an ASUS Tinker Board? False
Is this an STM32MP1 Board? False
Is this an OS environment variable special case? True

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: NEOPIXEL MATRIX NOT RESPONSIVE PYTHON FT232H

Post by mikeysklar »

You have the right idea. You will have to start with your original code and slowly adapt in the example I pasted or other NeoPixel examples to get going.

Here is another example to checkout submitted by a forum user. They were trying to get the NeoPixels to work at 800Hz and only successful at 400Hz.

viewtopic.php?f=47&t=176638&p=860282&hi ... el#p860282

Code: Select all

import time
import board
import neopixel_spi as neopixel
 
NUM_PIXELS = 1
PIXEL_ORDER = neopixel.RGB
COLORS = (0xFF0000, 0x00FF00, 0x0000FF)
DELAY = 0.1
 
spi = board.SPI()
 
pixels = neopixel.NeoPixel_SPI(spi,
                               NUM_PIXELS,
                               pixel_order=PIXEL_ORDER,
                               frequency=3200000,
                               auto_write=False)
 
while True:
    for color in COLORS:
        for i in range(NUM_PIXELS):
            pixels[i] = color
            pixels.show()
            time.sleep(DELAY)
            pixels.fill(0)

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

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