jnthas / clockwise

do-it-yourself, full-featured and smart wall clock device
https://clockwise.page
MIT License
304 stars 39 forks source link

Color mapping issue #4

Closed spad closed 2 years ago

spad commented 2 years ago

My display seems to work in BGR instead of RGB: This simple code show the attacched image

  uint16_t myRED = dma_display->color565(255, 0, 0);
  uint16_t myGREEN = dma_display->color565(0, 255, 0);
  uint16_t myBLUE = dma_display->color565(0, 0, 255);
  dma_display->setTextSize(1);
  dma_display->setTextColor(myRED);
  dma_display->setCursor(0, 0);
  dma_display->println("This is RED");
  dma_display->setTextColor(myBLUE);
  dma_display->setCursor(0, 32);
  dma_display->print("This is BLUE");  
  dma_display->setTextColor(myGREEN);
  dma_display->setCursor(0, 50);
  dma_display->print("This is GREEN"); 

color test

Is there a simple fix to manage that? Of course I could just switch the channels in color565 function, but when I use mariobros clock, the assets are RGB565 hardcoded. Maybe there is a config flag? Another option would be shitch channels i MatrixPanel_I2S_DMA::updateMatrixDMABuffer method....

spad commented 2 years ago

I solved swapping R1 <-> B1 and R2<->B2 pin mapping.