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.
Worked for me…thanks for the information
Worked as described… awesome… thanks !!
Worked like a treat.
Thanks for the clear and concise info. Appreciated.
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).
//
Yes, this worked with Ubuntu Mate on my raspberry.
Thanks!
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.
Nice tip, worked fine, thanks
Brilliant worked first time, less complicated than other options
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
Worked, thanks
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.