Projects, Reviews & News

[Solved] Upside down Raspberry Pi touch screen

upside down raspberry pi screen

If you just installed the latest version of Rasbian on your Raspberry Pi, or have a recent version installed, chances are that your 7″ touch screen will be upside down.

This is because they decided to change the standard orientation of the raspberry pi touch screen, in one of the latest updates.


As the official casing for the 7″ touch screen was released before this update, the default orientation of the screen will now be upside down. Whether you want to hang the raspberry pi case on the wall, or put in on a table, the 180 degrees rotation is not optimal.

Fortunately, the fix is very easy, and you can have your raspberry pi flipped back from upside down with a single line of code.

How to flip the Raspberry Pi touch screen

First of all, you should be aware that several methods exists to rotate, flip or mirror the raspberry pi screen. Do NOT use the display_rotate functionality, as this will require unnecessary additional processing of graphics, and will only rotate the display, not the touch input.

To flip the raspberry pi touch screen back from upside down, open a terminal and type in the following command:

sudo bash -c "echo -e '\n#Rotate touch screen 180\nlcd_rotate=2' >> /boot/config.txt"

This should add the line lcd_rotate=2 to your /boot/config.txt file, and if you do a restart, your raspberry pi should now boot up with the right screen orientation in the future.

Of course, you could just add this line to the file yourself, using a text editor.

If this worked for you, consider leaving a comment.

Also, check out this source for other great tips on configuring the 7″ Raspberry Pi touch screen.


By at .


  1. Yogesh Kalnar's Gravatar Yogesh Kalnar
    August 11, 2020    

    Worked for me…thanks for the information

  2. Dave's Gravatar Dave
    April 28, 2020    

    Worked as described… awesome… thanks !!

  3. Tony Flynn's Gravatar Tony Flynn
    April 12, 2020    

    Worked like a treat.
    Thanks for the clear and concise info. Appreciated.

  4. Per Tomas uusitalo's Gravatar Per Tomas uusitalo
    December 30, 2017    

    Ok, it works.

    But “new” problem with bad visibility from upper view, its like looking on a really old LCD TV from the side, the picture get bad.

    Is there any case to Raspberry pi 7″ screen where this problem is properly fixed?
    With right rotation from start and good visibility from top (as it is from right and left).


  5. iris's Gravatar iris
    October 30, 2017    

    Yes, this worked with Ubuntu Mate on my raspberry.

    I had issues with “DISPLAY_ROTATE=2” and a separate batch file to invert my touchscreen was a pain.
    Would recommend to change the memory to 128MB also, by removing the # because default this is set to 64MB.

  6. BJ's Gravatar BJ
    October 6, 2017    

    Nice tip, worked fine, thanks

  7. Paul's Gravatar Paul
    October 5, 2017    

    Brilliant worked first time, less complicated than other options

  8. Judd's Gravatar Judd
    September 13, 2017    

    I had to flip the screen and touch screen after changing ad card for stretch update. Yours looked the easiest way…. worked straight away after a reboot. Brilliant! Thanks

  9. Kieran's Gravatar Kieran
    September 2, 2017    

    Worked, thanks

  10. dave's Gravatar dave
    April 2, 2017    

    No this didn’t work. Display_rotate=2 works for flipping the display, but the touch still stays opposite. If i do lcd_display=2, the display is upside down, but if I touch the right corner, the right corner gets the cursor.

Leave a Reply to Dave Cancel reply

Your email address will not be published. Required fields are marked *