Display ILI9341 red and blue values are reversed
{255, 0, 0} produces blue, {0, 0, 255} produces red
Ok. It looks the different versions of the M5STACK blocks have different wiring.
Black version: {255, 0, 0} produces blue, {0, 255, 0} produces green {0, 0, 255} produces red
Red version {0, 0, 0} produces white {255, 255, 255} produces black {255, 255, 0} produces red {255, 0, 255, 0} produces green {0, 255, 255} produces blue
Same Here. Screen Mirrored and color (kind-of) reversed. Sparkfun. Last update with wcc.
I think we have two options:
- The color mapping is in the configuration for the board. Now means three different types for the M5STACK: black, gray and red.
- We configure the color mapping with your own command (similar to e.g.
gdisplay.invert())gdisplay.colormapping()
Suggestion:
gdisplay.colormapping({rbitstart, rbitend, rinv},{gbitstart, gbitend, ginv},{bbitstart, bbitend, binv})
?bitstart: bitnumber start
?bitend: bitnumber end
?inv: invert bits (option)
Disadvantage: all color constants like gdisplay.BLACK have to be implemented differently.
Hi there,
I Have 2 different ILI9341 screens :
-
QVGA 240x320:

-
2.4 TFT SPI 240x320

I had to patch the ili9341 driver to get correct colors (BGR) and not mirrored display.
I don't know how to make my changes so they benefit others. I see different options:
- Make this 2 modifications
- Add a
_MIRRORvariant to the orientation flag. Then there will be 4 new flags likegdisplay.LANDSCAPE_MIRROR...gdisplay.PORTRAIT_FLIP_MIRRORhttps://github.com/whitecatboard/Lua-RTOS-ESP32/wiki/GDISPLAY-module#gdisplaysetorientorientation But I do not know how to implement that for other drivers (except ST7735* who share most of the code with the ILI9341). Care must be taken for the touch orientation also. - Add a
gdisplay.colormapping()as you suggest, But I don't know how to implement that for other drivers.
-
Make a new drivers called
ILI9341_BGR,ILI9341_MIRRORandILI9341_BGR_MIRROR -
Add some compile time options like in this patch https://github.com/whitecatboard/Lua-RTOS-ESP32/pull/271/commits/fbdf82382936044ad1be6094228b3870798dc3fc from @c-logic
-
Add some parameters to the
gdisplay.attach()function
My personal preference goes for a new driver ILI9341_BGR and new orientation flags *_MIRROR
What do you think ?
Hi there,
I Have 2 different ILI9341 screens :
1. QVGA 240x320:  2. 2.4 TFT SPI 240x320
I had to patch the ili9341 driver to get correct colors (BGR) and not mirrored display.
I don't know how to make my changes so they benefit others. I see different options:
1. Make this 2 modifications * Add a `_MIRROR `variant to the orientation flag. Then there will be 4 new flags like `gdisplay.LANDSCAPE_MIRROR` ... `gdisplay.PORTRAIT_FLIP_MIRROR` https://github.com/whitecatboard/Lua-RTOS-ESP32/wiki/GDISPLAY-module#gdisplaysetorientorientation But I do not know how to implement that for other drivers (except ST7735* who share most of the code with the ILI9341). Care must be taken for the touch orientation also. * Add a `gdisplay.colormapping()` as you suggest, But I don't know how to implement that for other drivers. 1. Make a new drivers called `ILI9341_BGR`, `ILI9341_MIRROR` and `ILI9341_BGR_MIRROR` 2. Add some compile time options like in this patch [fbdf823](https://github.com/whitecatboard/Lua-RTOS-ESP32/commit/fbdf82382936044ad1be6094228b3870798dc3fc) from @c-logic 3. Add some parameters to the `gdisplay.attach()` functionMy personal preference goes for a new driver
ILI9341_BGRand new orientation flags*_MIRRORWhat do you think ?
Could you please share the code to correct the mirrored screen?
Done, see PR #393
Thank you so much!