iLi9486 is showing mirrored text?

I am using a 3.5 display with the ic model iLi9486 on a shield.
I have tried to use the thread here
I am using the LCDWIKI library from here wnich has no Invert_GS that I can find.
I have gone through the library files LCDWIKI_KBV.h and LCD_WIKIGUI.h but I can't find an alternative.
If there is someone who uses the LCDWIKI library do you know of a way of turning the text the right way round?
Thanks

Why not use the library they're using (at the related subject) and change the line noted there?

(Or use it in a heads-up display?)

I have already downloaded the library and examples for the WIKI version, I was hoping it would just be something simple that I am missing.

I have downloaded the friend library they have used (at the related subject) and when I run it one of the simple text sketches shows up the right way round?
I am still interested to find the solution to my original request but I will investigate using this library.

Maybe the WIKI is for non-conforming hardware configs.

I don't think so, the sketch includes the lines


//the definiens of 8bit mode as follow:
//if the IC model is known or the modules is unreadable,you can use this constructed function
//LCDWIKI_KBV mylcd(ILI9341,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//LCDWIKI_KBV mylcd(ILI9325,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//LCDWIKI_KBV mylcd(ILI9328,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//LCDWIKI_KBV mylcd(HX8357D,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//LCDWIKI_KBV mylcd(HX8347G,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//LCDWIKI_KBV mylcd(HX8347I,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
LCDWIKI_KBV mylcd(ILI9486,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//LCDWIKI_KBV mylcd(ST7735S,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset

and tells you to uncomment one which I have done in the above code. Without it I get nothing.

If you post a link to your display, or a picture of the backside, then we would know if it is a MCUFriend style TFT for UNO. And if the same modification as in https://forum.arduino.cc/t/3-5-tft-lcd-ili9488-display-is-having-mirrored-text/1129159 can be applied, just on a different code line.
Did you try with the MCUFriend_kbv library?

The modification isn't necessary, the sketch works fine with the MCUfriend library.
I would still like to know if it is possible to use the wiki library though.

see post 4.

sure

In void LCDWIKI_KBV::Set_Rotation(uint8_t r) line 812 ff:

	else if(lcd_driver == ID_9486)
	{
		uint8_t val;
		switch (rotation) 
		{
		   	case 0:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR; //0 degree 
		     	break;
		   	case 1:
		     	val = ILI9341_MADCTL_MV | ILI9341_MADCTL_ML | ILI9341_MADCTL_BGR ; //90 degree 
		     	break;
		 	case 2:
		    	val = ILI9341_MADCTL_MY |ILI9341_MADCTL_BGR; //180 degree 
		    	break;
		   	case 3:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_MY | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR; //270 degree
		     	break;
		 }
		 writeCmdData8(MD, val); 
	}

change to:

	else if(lcd_driver == ID_9486)
	{
		uint8_t val;
		switch (rotation) 
		{
		   	case 0:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR; //0 degree 
		     	break;
		   	case 1:
		     	val = ILI9341_MADCTL_MV | ILI9341_MADCTL_ML | ILI9341_MADCTL_BGR ; //90 degree 
		     	break;
		 	case 2:
		    	val = ILI9341_MADCTL_MY |ILI9341_MADCTL_BGR; //180 degree 
		    	break;
		   	case 3:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_MY | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR; //270 degree
		     	break;
		 }
         val ^= 0x80; // from: if (_lcd_capable & INVERT_GS) val ^= 0x80;
		 writeCmdData8(MD, val); 
	}

maybe.

thanks ZinggJM,

It doesn't make any difference.

If I put it where I think you are saying, in LCDWIKI_KBV.cpp, (line 824 on my version), it loads fine
(though the first time I try to upload it I get lots of errors though it uploads but not the second time, the second time it loads without the errors. I think it has always done that so ignore it for now.

I am just adding the line

val ^= 0x80; // from: if (_lcd_capable & INVERT_GS) val ^= 0x80;

arn't I?

If I add the line

 mylcd.INVERT_GS;

into the setup of my sketch I get
Compilation error: 'class LCDWIKI_KBV' has no member named 'INVERT_GS'
I can't find what the wiki instruction is for INVERT_GS.

This was meant as explanation, taken from MCUFriend_kbv.cpp.
See the other related topic.

I did not check if LCDWIKI calls setRotation on init.
This is all I can and am willing to provide as help.
I propose you consult the code of libraries you use yourself.

See e.g.:

// Initialization lcd modules
void LCDWIKI_KBV::Init_LCD(void)
{
	reset();
	if(lcd_model == 0xFFFF)
	{
		lcd_model = Read_ID(); 
	}
//	uint16_t ID = Read_ID(); 
	start(lcd_model);
//	Set_Rotation(0);
}

I can't find a code of libraries, that is the problem.

I have spent quite a time testing and have been altering the LCDWIKI_KBV.cpp file.
I have enclosed a section of it below, what I have done is leave my sketch (the display_string.ino sketch from the examples) looking at Set_rotation(0); in the setup section and altering the lines in the LCDWIKI_KBV.cpp file
TL VERT CORRECT means the text starts in the top left corner, prints down the left side (vertical) and is the correct way round.
TR HORIZ WRONG means the text starts in the top right corner and prints horizontally to the left and is mirrored.
Nothing I do gets it to start in the bottom corners?
Can anyone see a pattern that might get it to rotate and print the correct way when it does?
Does anyone know what else I can try to get it to rotate the screen to start at the bottoms?

	else if(lcd_driver == ID_9486)
	{
		uint8_t val;
		switch (rotation) 
		{
		   	case 0:
                //val = ILI9341_MADCTL_MX |ILI9341_MADCTL_BGR; //TL HORIZ WRONG
                //val = ILI9341_MADCTL_MY |ILI9341_MADCTL_BGR; //TL HORIZ WRONG
		     	//val = ILI9341_MADCTL_ML |ILI9341_MADCTL_BGR; //TR HORIZ CORRECT
		     	//val = ILI9341_MADCTL_MV |ILI9341_MADCTL_BGR; //TL VERT CORRECT
		     	//val = ILI9341_MADCTL_MV | ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR ; //TL VERT CORRECT
		     	//val = ILI9341_MADCTL_MY | ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR ; //TL HORIZ WRONG
		     	//val = ILI9341_MADCTL_MX | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR ; //TL VERT CORRECT
		     	//val = ILI9341_MADCTL_ML | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR ; //TR VERT WRONG
		     	//val = ILI9341_MADCTL_ML | ILI9341_MADCTL_ML | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR ; // TR VERT WRONG
		     	//val = ILI9341_MADCTL_ML | ILI9341_MADCTL_MV | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR ;
		     	//val = ILI9341_MADCTL_MV | ILI9341_MADCTL_MX | ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR ;//TL VERT CORRECT
                val = ILI9341_MADCTL_MV | ILI9341_MADCTL_MY | ILI9341_MADCTL_MY | ILI9341_MADCTL_BGR ;//TL VERT CORRECT
		     	break;
		   	case 1:
		     	break;
		 	case 2:
		    	break;
		   	case 3:
		     	break;
		 }
		 writeCmdData8(MD, val); 
	}

The controller of your display might be an ILI9487. MCUFriend_kbv handles this the same as ILI9488. Did you ever check the ID reported by Read_ID() ?

You could check to force ID of ID_9488.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.