Flip / Mirror to get a hud

I bought a hud for a smartphone ( http://www.ebay.de/itm/142122387193 ) but want to use it with my arduino tft.

I use the mcufriend library. ( but if i should use another no problem )

So now i need a function to flip / mirror the display.

Hoi Muurman.

This is a graphic display, which means the characters are drawn on the screen rather than characters picked from a list in ROM.
That drawing works similar however.
So the characters are looked up in some table, which is usually provided with the library.
If you need flipped and / or mirrored characters, you should look for, or create your own.
A HUD usually uses quite large characters so it wouldn't surprise me if you need to build your own set anyway.
If you decide to create your own characterset, consider uploading it to this thread so others can benefit from your work too.
That is how things work on forums like this one, people help each other.

If i found how i will share it here.

i now had a look in the library and see:
// Standard ASCII 5x7 font

static const unsigned char font PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00,
0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
0x1C, 0x3E, 0x7C, 0x3E, 0x1C,
0x18, 0x3C, 0x7E, 0x3C, 0x18,

and a lot more...
so how should i design my own ??

and i also think i don't need to make fonts. This because i also have seen people who had the problem that their lcd was displaying in mirror :slight_smile: so i think it is just a change in how to write to the display.

here some links with people have the problem the screen is mirrored:

so... some people have the problem it is mirrored... i want it to be mirrored ...

You can make most TFT controllers do a horizontal mirror or a vertical mirror.
This is how you select different "rotations" of a display. e.g. Landscape, Portrait_Rev etc.

There is no need to alter a general purpose library or font.
You simply change the controller registers as a one-off in setup().


Rotation is not mirror.

But what do you mean with : You simply change the controller registers as a one-off in setup(). ?
Can you post an example?

There are plenty of examples in plenty of libraries. e.g. setRotation() for PORTRAIT, LANDSCAPE, PORTRAIT_REV, LANDSCAPE_REV

This involves changing write directions.

If you say which controller and which library, someone would probably tell you what command(s) to use.



i use mcufriend library.


But it should be mirror because i want to make a hud ( head up display )

found it.

tft.WriteCmdData(0x36,0x02); does it.

So now i got the writing in mirror/flip mode.
But also i write in landscape . But if i use rotation from the library it isn't mirrored anymore.

Say which controller you have.

I could then suggest a single statement in setup() that would enable you to do everything in the library with the appropriate mirroring.


Controller ILI9481 .

But whatever i do: tft.WriteCmdData(0x36,0x02) or for example tft.WriteCmdData(0x36,0x01) or tft.WriteCmdData(0x36,0x00) it mirror's , so it looks like it doesn't matter what i write to 0x36 ???

This should work for your ILI9481. Note that it does not work for a R61581.
e.g. in setup() :

    uint8_t d[5];
    d[0] = 0x14;    //force REV, GS
    tft.pushCommand(0xC0, d, 1);

This is in fact inverting the GateScan (GS) rather than SS because the ILI9481 does not have a specific invert SS Panel Configure bit.

So you actually need to use PORTRAIT_REV instead of PORTRAIT.

I have tried the graphictest_kbv sketch with this mod. And read the display via a real-life mirror.


Hi david,

yes now the screen is Potrait rev and mirror.

But i need landscape and mirror. But i think with your example i should be able to find that.

this pdf i'm looking for info. : http://www.ncsys.co.jp/webshop/GTV350MPZI04(ILI9481).pdf

I use v0.35 of the ILI9481 datasheet.
Your link goes to v0.21.

The 8.2.39. Panel Driving Setting (C0h) description is on page#103 for v0.21.
The 8.2.40. Panel Driving Setting (C0h) description is on page #101 for v0.35.

I note that v0.21 does not have the GS in bit#2. Searching the PDF does not find the Register Bit2.

Does your ILI9481 respond correctly?
There is no mention of the GS addition in the Errata.


I just see i can do i setRotation also ..

sorry .

i thought writing to adress C0 is a replacement for the setRotation.

It's working now. Thanks.

If i have a complete working hud i post foto's and code.

Just run the graphictest_kbv sketch. It should look perfect from a mirror in every aspect.

Have you tried it?

Just develop your application on a regular display.
When you want to mount it in the "head-up", add those statements to setup().