LCDWIKI_kbv icon indicating copy to clipboard operation
LCDWIKI_kbv copied to clipboard

Mirror Display on ILI9341

Open DMohammed opened this issue 3 years ago • 1 comments

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;
		 }

DMohammed avatar Apr 13 '21 08:04 DMohammed

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

diegopersello avatar Aug 12 '23 14:08 diegopersello