Rotating Image on Raspberry Touch Screen

Raspberry Pi 4 - FLIRC case Raspberry Pi 4 with FLIRC case

I’m rebuilding my Raspberry Pi called becky, it’s a centralised RSyslog server and a home office monitoring station. This system has the official Raspberry Pi 7” touch screen attached to it, and it has a strange issue: out of the box, with a fresh Raspbian OS install, the image on the display appears upside down. I thought I must have physically connected the display incorrectly, but short research confirmed I wasn’t the only one with such a weird issue.

How To Rotate Display Image on Raspberry

Like many other RPi things, settings for the display or touch screen are configured in the /boot/config.txt file.

For external (HDMI) displays, the setting is

display_rotate=0

But for the official touch screen (because it’s connected via on-board graphics slot and not HDMI), the setting is this:

lcd_rotate=2

For both of these variables, value means the desired rotation (but somehow for me only values 0 and 2 work):

  • 0 – no rotation
  • 1 – 90 degrees rotation
  • 2 – 180 degrees rotation (that’s why it’s turning picture upside down)
  • 3 – 270 degrees rotation

To apply the setting, you need to edit the /boot/config.txt file, add (or change value) for the lcd_rotate parameter, save the file and then reboot your Raspberry Pi.

See Also




Keep Learning with Me

Follow me on Facebook and Twitter or jump into Telegram chat!:
Recommended Software
I use Brave browser, it's awesome: Brave Browser I'm also a fan of SetApp for macOS: SetApp for macOS
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!
Recent Articles
18 Jun 2021

CentOS 8.4 Released

17 Jun 2021

yum/dnf Package Manager Basics

07 Jun 2021

/proc/mdstat

Recent Tweets