jgarff / rpi_ws281x

Userspace Raspberry Pi PWM library for WS281X LEDs
BSD 2-Clause "Simplified" License
1.76k stars 619 forks source link

Selected GPIO not possible on RPI 4 8GB (GPIO 18) #430

Closed gbkwiatt closed 3 years ago

gbkwiatt commented 3 years ago

Not sure if I am doing something wrong, I compiled library and I am using it in cpp.

#define TARGET_FREQ WS2811_TARGET_FREQ
#define GPIO_PIN 18
#define DMA 5
#define STRIP_TYPE WS2811_STRIP_RGB // WS2812/SK6812RGB integrated chip+leds
//#define STRIP_TYPE                            WS2811_STRIP_GBR        // WS2812/SK6812RGB integrated chip+leds
//#define STRIP_TYPE                            SK6812_STRIP_RGBW       // SK6812RGBW (NOT SK6812RGB)
#define LED_COUNT 10

ws2811_t ledstring =
        {
            0,           // device - set automatically
            0,           // rpi_hw - set automatically
            TARGET_FREQ, // frequency
            DMA,         // DMA num
            GPIO_PIN,    // GPIO-Pin
            0,           // invert
            LED_COUNT,   // LED count
            125,         // brightness
            STRIP_TYPE,  // strip type
            0            // channel
        };
ws2811_init(&ledstring)

This is my led string. and I am getting error -11 on init. Why is that ? In python it all works fine

I think it's the way I am initialising it which is wrong. But I can't figure it out :/