lcdwiki / LCDWIKI_kbv

Driver for Arduino with 8Bit & 16Bit 8080 Databus
MIT License
17 stars 13 forks source link

Mirror Display on ILI9341 #3

Open DMohammed opened 3 years ago

DMohammed commented 3 years ago

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 commented 10 months ago

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