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
    Location
    Roma (IT, EU)
    Posts
    379

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

    SOLVED:
    Had to add
    Code:
    tft.invertDisplay(false);
    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.

    Fernando


    Hello,
    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.
    https://www.pjrc.com/store/display_ili9341_touch.html

    I wired it following the table at:
    https://www.pjrc.com/store/display_ili9341_touch.html

    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:

    Code:
    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
    Done!
    I would guess the pixel format is wrong, any idea how to fix it?
    Any way to invert colors in the code?

    I tried

    Code:
    tft.invertDisplay(true);
    without any effect (exactly same inverted colors).

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

    Many thanks,
    Fernando
    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
  •