adafruit / Adafruit_Blinka

Add CircuitPython hardware API and libraries to MicroPython & CPython devices
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
MIT License
457 stars 346 forks source link

LED Channel as one of parameters for NeoPixel #816

Open ExcitePrime opened 6 months ago

ExcitePrime commented 6 months ago

Hello, can you please add the LED Channel as one of the parameters when creating an instance of NeoPixel? This is so that we could use GPIO13 and GPIO19, which are on a different LED channel on a Raspberry Pi 4 Screenshot 2024-04-19 131318

dhalbert commented 6 months ago

This would be handled internally by https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/bcm283x/neopixel.py so you wouldn't need to specify the channel.

But there are limitations that appear to make using both channels not possible. See https://github.com/adafruit/Adafruit_Blinka/issues/103, especially the last post. That issue, or the Blinka repo in general, is the best place for this discussion.

ExcitePrime commented 6 months ago

So the CircuitPython NeoPixel works only on PWM0 pins (GPIO12 and 18) and not on PWM1 (GPIO13 and 19) pins coz the LED_CHANNEL on the neopixel.py is explicitly set to PWM0? That's too bad, I personally like the functions of the NeoPixel class. I also essentially made a script that I just found out that is similar to the multistrandtest.py (coz I'll be running two strips), so I think I'll stick to rpi_ws281x for now. Thanks

On Fri, Apr 19, 2024, 9:26 PM Dan Halbert @.***> wrote:

This would be handled internally by https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/bcm283x/neopixel.py so you wouldn't need to specify the channel.

But there are limitations that appear to make using both channelsnot possible. See adafruit/Adafruit_Blinka#103 https://github.com/adafruit/Adafruit_Blinka/issues/103, especially the last post.

— Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_Blinka/issues/816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOZAPMISHNXLEGIVQWDRT2DY6ELSHAVCNFSM6AAAAABGOQBM36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRWGU4DIOBYGQ . You are receiving this because you authored the thread.Message ID: @.*** com>

dhalbert commented 6 months ago

Transferring this issue to the Blinka repo. I don't understand what the issue is, but it seems to be a limitation in how to deal with the PWM channels.

makermelissa commented 6 months ago

I'm going to reopen as it's a good suggestion, but I'll need to think about the best way to implement this without modifying the neopixel library.