Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror Display on ILI9341 #3

Open
DMohammed opened this issue Apr 13, 2021 · 1 comment
Open

Mirror Display on ILI9341 #3

DMohammed opened this issue Apr 13, 2021 · 1 comment

Comments

@DMohammed
Copy link

Hi

In some of ILI9341 LCD shields for Arduino, the content is mirrored. To fix this problem you should go to the LCDWIKI_KBV.cpp file in the line 845 and modify the code according to this:
From

switch (rotation) 
		{
		   	case 0:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR; //0 degree 
		     	break;
		   	case 1:
		     	val = ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR; //90 degree 
		     	break;
		 	case 2:
		    	val = ILI9341_MADCTL_MY | ILI9341_MADCTL_ML |ILI9341_MADCTL_BGR; //180 degree 
		    	break;
		   	case 3:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_MY| ILI9341_MADCTL_ML | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR; //270 degree
		     	break;
		 }

To

switch (rotation) 
		{
		   	case 0:
		     	val = ILI9341_MADCTL_ML | ILI9341_MADCTL_BGR; //0 degree 
		     	break;
		   	case 1:
		     	val = ILI9341_MADCTL_MY|ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR; //90 degree 
		     	break;
		 	case 2:
		    	val = ILI9341_MADCTL_MY|ILI9341_MADCTL_MX|ILI9341_MADCTL_MH|ILI9341_MADCTL_BGR; //180 degree 
		    	break;
		   	case 3:
		     	val = ILI9341_MADCTL_MX | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR; //270 degree
		     	break;
		 }
@diegopersello
Copy link

Muchas gracias por compartir este detalle. Me estab volviendo loco! Saludos desde Mar del Plata, Argentina.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants