Could not get NeoPXL8 Libary to work

So I just heard of NeoPXL8 library as a parallel version of the NeoPixel Library, and i want to try it out. Problem is I could not get it to work.

So to make sure that everything is working i first used the NeoPixel RGBWStrandtest on each of my 4 strips. And indeed they worked.

Now when i use the NeoPXL8 strandtest i get nothing on my strips.

Here is the sketch

    #include <Adafruit_NeoPXL8.h>

    #define NUM_LED 64  // Per strand. Total number of pixels is 8X this!


    int8_t pins[4] = { 18, 19, 24 , 25}; // GP## indices!

    Adafruit_NeoPXL8 leds(NUM_LED, pins, NEO_GRBW + NEO_KHZ800);


    void setup() {
      leds.begin();
      leds.setBrightness(32);
    }

    uint8_t frame = 0;

    void loop() {
      for(uint8_t r=0; r<8; r++) { // For each row...
        for(int p=0; p<NUM_LED; p++) { // For each pixel of row...
          leds.setPixelColor(r * NUM_LED + p, rain(r, p));
        }
      }
      leds.show();
      frame++;
    }

    uint8_t colors[8][3] = { // RGB colors for the 8 rows...
      255,   0,   0, // Row 0: Red
      255, 160,   0, // Row 1: Orange
      255, 255,   0, // Row 2: Yellow
        0, 255,   0, // Row 3: Green
        0, 255, 255, // Row 4: Cyan
        0,   0, 255, // Row 5: Blue
      192,   0, 255, // Row 6: Purple
      255,   0, 255  // Row 7: Magenta
    };

    // Gamma-correction table improves the appearance of midrange colors
    #define _GAMMA_ 2.6
    const int _GBASE_ = __COUNTER__ + 1; // Index of 1st __COUNTER__ ref below
    #define _G1_ (uint8_t)(pow((__COUNTER__ - _GBASE_) / 255.0, _GAMMA_) * 255.0 + 0.5),
    #define _G2_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ // Expands to 8 lines
    #define _G3_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ // Expands to 64 lines
    const uint8_t gamma8[] = { _G3_ _G3_ _G3_ _G3_ };    // 256 lines

    // Given row number (0-7) and pixel number along row (0 - (NUM_LED-1)),
    // first calculate brightness (b) of pixel, then multiply row color by
    // this and run it through gamma-correction table.
    uint32_t rain(uint8_t row, int pixelNum) {
      uint16_t b = 256 - ((frame - row * 32 + pixelNum * 256 / NUM_LED) & 0xFF);
      return ((uint32_t)gamma8[(colors[row][0] * b) >> 8] << 16) |
             ((uint32_t)gamma8[(colors[row][1] * b) >> 8] <<  8) |
                        gamma8[(colors[row][2] * b) >> 8];
    }

I am using a custom RP2040 board (literally no difference to the raspberry pi pico just with all the GPIO exposed)
Arduino IDE v 1.8.16 - Raspberry Pi rp2040 boards by Earl e. Philhower
Adafruit_NeoPXL8 v 1.1.0
RGBW SK6812 strips

The pins array may need to be 8 elements, with -1 for the unused pins

Adafruit_NeoPXL8 class reference

1 Like

Coool ! It worked .

Not sure what the example sketch is supposed to output but i am seeing moving colors in the strips, so its working now.

Thank you very much good sir.