Page 1 of 1

R/B in gLCD_ILI9341 component?

Posted: Fri Sep 09, 2022 11:30 pm
by MJU20
I've got a display working with the gLCD_ILI9341_SPI1 component.
It's a 240/320 display like this one: https://nl.aliexpress.com/item/10050016 ... pt=glo2nld

But, maybe my fault: the R and B in the setForeGround macro are switched?

If I set the R to 255 and the rest to zero, I would suspect that I would get a red foreground? No it's 100% blue.
Same when I set B to 255 and the rest to zero... 100% red...

The green is OK but the R and B seem to be switched.
If I "invert the colours" in the gLCD_ILI9341_SPI1 component properties I get all messed up colours.

I need to see if the same issue is there in the background colours..
Is this a known issue? Or am I doing something wrong?

Re: R/B in gLCD_ILI9341 component?

Posted: Mon Sep 12, 2022 10:43 am
by BenR
Hello,

Looking at the component code it seems to correspond to the datasheet where it first sends red (MSb), then green and then blue (LSb) for each pixel.

RGB.jpg
RGB.jpg (74.52 KiB) Viewed 1836 times

It could be the display manufacturer has wired up the blue LEDs to the red channel. I'll add in a property to allow the colours to be switched.

Edit this is now live via the update system.

Re: R/B in gLCD_ILI9341 component?

Posted: Mon Sep 12, 2022 5:15 pm
by MJU20
Thank you BenR, this seems to do the trick.

When I "swap" R and B in the new component, RED and BLUE are shown like they should!

Thanks!