R/B in gLCD_ILI9341 component?

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
MJU20
Posts: 353
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 101 times
Been thanked: 70 times

R/B in gLCD_ILI9341 component?

Post 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?

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: R/B in gLCD_ILI9341 component?

Post 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 1838 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.

MJU20
Posts: 353
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 101 times
Been thanked: 70 times

Re: R/B in gLCD_ILI9341 component?

Post 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!

Post Reply