Change colour order?

After a brief period of confusion I’ve determined that my P2 128x64 panel uses RBG colour order. For instance, scrollingLayer.setColor({0x00, 0xff, 0x00}); gives blue text, not green.

Is there a way to configure SmartMatrix to send RBG, to remove the overhead of rearranging the colour-order manually before swapping buffers?

  for (uint16_t i = 0; i < kMatrixWidth * kMatrixHeight; i++)
    buffer[i] = rgb24(buffer[i].red, buffer[i].blue, buffer[i].green);

It’s easy for Teensy, not for ESP32. What platform are you using?

I’m using a Teensy 4.1.

I modified MatrixHardware_Teensy4_ShieldV5.h to wrap each of the pin definitions in an #ifndef block. That works fine if I declare the regular pin mapping in my sketch before including SmartMatrix. But when I swap the pins G0 & B0 and/or G1 & B1 I get a corrupted display.

I should read more carefully. I found the colour-order config just above the code I modified. That works perfectly. Thanks for causing me to re-read it.

I just wrote some documentation on the feature, looks like you don’t need it anymore, but do you mind proofreading it?

Thanks for your wiki edit too BTW

That’s perfect. I hadn’t thought of copying the matrix config into my own sketch folders. Thanks, Louis.

1 Like