Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 1 of 1

Thread: T4.1 + ILI9431_t3 (2.4" display): inverted colors

  1. #1
    Senior Member
    Join Date
    Oct 2015
    Roma (IT, EU)

    T4.1 + ILI9431_t3 (2.4" display): inverted colors

    Had to add
    which is so very strange!
    I mean: if I do not add the instruction at all, I get inverted colors.
    If I add the instruction with "true" as argument, I get inverted colors.
    If I add the instruction with "false" as argument, which to me it would mean "do not invert colors", I get right colors!

    Leaving the original message for reference.


    just received a new 2.4" TFT display with integrated touchscreen, for a project based upon Teensy 4.1.

    It appears identical as this one, also same labels etc.

    I wired it following the table at:

    and tried the sample sketch "ILI9341_t3 -> graphictest" as is, without any modification (so no need to copy/paste the code I'd say).

    Arduino IDE is 1.8.19 and TeensyDuino is 1.57.

    Problems is, I get inverted colors: "black" is actually white, "yellow" shows as blue, "green" as magenta, and so on.

    The sample sketch prints a few diagnostic infos on the serial monitor:

    Display Power Mode: 0xDC
    MADCTL Mode: 0x48
    Pixel Format: 0x5
    Image Format: 0x20
    Self Diagnostic: 0x0
    Benchmark                Time (microseconds)
    Screen fill              205514
    Text                     9641
    Proportional Text        10017
    Lines                    72369
    Horiz/Vert Lines         17478
    Rectangles (outline)     11218
    Rectangles (filled)      422184
    Circles (filled)         68060
    Circles (outline)        50179
    Triangles (outline)      17078
    Triangles (filled)       146560
    Rounded rects (outline)  18121
    Rounded rects (filled)   468338
    I would guess the pixel format is wrong, any idea how to fix it?
    Any way to invert colors in the code?

    I tried

    without any effect (exactly same inverted colors).

    Tests show just fine on the screen (lines, strings, squares etc.), only... with inverted colors.

    Many thanks,
    Last edited by XFer; 10-25-2022 at 09:59 PM. Reason: SOLVED

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts