Open Tetrikus opened 6 years ago
This pcm implementation has been included in the original library by jgarff The library now supports PWM, PCM and SPI Goto https://github.com/jgarff/rpi_ws281x and look at https://github.com/jgarff/rpi_ws281x/blob/master/python/examples/SK6812_strandtest.py assuming you are using python. Ignore the comments that only PWM is supported. Adjust the parameters at the beginning, e.g. LED_PIN=40 to select PCM Let me know how it goes.
Thanks @tvoverbeek for your response. I tried this as well, but no success so far. The lightstrip does just nothing at all. :( You said LED_PIN=40
to select PCM. I guess I'm right, when I use LED_PIN=21
when using GPIO.BCM mode, right? When I try LED_PIN=40
it throws an error, that this GPIO-Pin is not possible.
@Tetrikus Yes, you are correct it is LED_PIN=21
for PCM. Sorry about the mix-up of BCM and GPIO header pin numbers.
Did you (re)build the library following the instructions in README.md?
Suggest to first edit main.c to set the right parameters (GPIO_PIN, STRIP_TYPE, etc.) and rebuild the library and test program.
Before building remove any old versions first.
Use the test program to test your led strip. For PCM use the argument -g 21
.
The python code uses this library.
Just to be sure, Do you have connected power to the LED strip? Data alone is not enough.
@tvoverbeek Thanks for your answer! Yes, I dud rebuild the library after changing the settings in main.c. What I didn't do is removing the old stuff. Even if I use the test program, the strip does nothing. I do use these strips in many projects (via PWM) and never had these issues. The strip has 5V and a signal which is level shifted and has a resistor. I guess thats fine too, right?
I think I will try to install the raspberry from scratch and start over. Or do you have any more hints?
Can you run the same test program using PWM? (GPIO 18, pin 12). Does that work?
Hi @tvoverbeek. Thanks again and sorry for the late answer. Unfortunately I cannot test it that quickly on PWM, since everything is soldered together. But I'll have to try that again. I do use a couple of electronical devices on this project, do you think it's possible that something is interfering with the PCM channel? I do use an I2C Expander and an I2C AC Light Dimmer Board for example. And I noticed, that the Neopixel's first LED is sometimes lighting up, if I send some dimming commands to the device. Does that make any sense to you?
Thanks again for helping out, even when it is not related to your software at all, I guess.
I2C should not interfere with the PCM. I suppose you run your program as root. This is needed because the code manipulates the GPIO PCM hardware directly.
WS2813 LEDs can be power hungry. With all the extra hardware is there maybe a power problem? It is best to feed the LEDs from a separate power supply. See https://learn.adafruit.com/adafruit-neopixel-uberguide, especially the section about powering neopixels. But you might know all this already.
When I connect the Neopixels to PIN 40 and install this library, nothing is happening when I start the test script. No error but also no changes on the neopixels. Is there anything I could try to debug this? Thanks for any hint.