Raspberry Pi

How to Rotate the Screen of the Raspberry Pi

Controlling your Raspberry Pi display is one of those features that every user needs to learn, as this will help them set up the device display whenever it’s required. Rotating the Raspberry Pi screen is one of those features that are helpful, especially when you are using a touchscreen display for your device, as this will allow you to rotate your screen at the desired angle. It can also help you if you want to use your screen vertically or if the display is mounted upside down.

This tutorial provides you with some methods that will help you in rotating your Raspberry Pi screen.

How to Rotate the Screen of the Raspberry Pi

There are two methods to rotate the screen of your Raspberry Pi device and both steps are pretty simple which can easily be completed within seconds. The details of both these methods for rotating the screen are discussed below:

1: Rotating the Screen of Raspberry Pi from Preferences

You can rotate the screen of Raspberry Pi from the preferences using the following steps:

Step 1: Go to the main menu of Raspberry Pi and click on the “Screen Configuration” option in the “Preferences” section.

Step 2: Now, right click on the “HDMI-2” option and in the “Orientation” section, click on the “inverted” option. You can also pick “right” and “left” options.

Next, click on the “tick” button to rotate the Raspberry Pi screen.

A dialog box will appear for confirmation:

This will rotate the Raspberry Pi screen.

2: Rotating the Screen of Raspberry Pi through Terminal

You can also rotate Raspberry Pi screen through the following command as well as this command will work for Raspberry Pi 4 model.

$ DISPLAY=:0 xrandr --output HDMI-2 --rotate inverted

From the above command, you will also need to ensure the HDMI port number as in our case we are using HDMI port 2 for Raspberry Pi display.

If you want to rotate your Raspberry Pi screen back to the normal position, execute the following command:

$ DISPLAY=:0 xrandr --output HDMI-2 --rotate normal

If you have old Raspberry Pi model, you can rotate the screen by opening the boot configuration file using the following command:

$ sudo nano /boot/config.txt

Then, find the line “display_hdmi_rotate=0” in the configuration file. The “0” value defines that the display is set to a normal position and if you want to rotate your screen, you have to change it to 1, 2, or 3. The value “1” corresponds to 90-degree rotation, “2” corresponds to 180-degree rotation, while “3” will rotate the screen to a 270-degree angle.

Conclusion

Knowing how to rotate the Raspberry Pi screen is important as it allows you the freedom to use your device display in any direction you want in which you feel more comfortable. The above two methods are pretty simple to follow for the Raspberry Pi users who want to rotate their screens. Either pick a desktop interface method or use the terminal command; both methods will work effectively on your Raspberry Pi. However, for the older Raspberry Pi model, you have to make a slight change in the boot configuration file to rotate the screen of the Raspberry Pi through the terminal.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.