Especially if you have connected an external screen, it can happen that you are faced with the problem of wanting to rotate the screen output.
A typical use case is, for example, when you use your RaspberryPi to build a MagicMirror. For this purpose, the screen is often hung up rotated by 90 °. Now of course you also have to rotate the screen output by 90 °.
How this works and what you need to know is described in the following article.
Before you start with this article, you should have prepared the RaspberryPi so that it can be reached via the network and controlled via SSH.
In the following list you will find all the parts you need to implement this article.
Log in via SSH on the RaspberryPi
To get started, you first need to log in to RasPi with SSH on Putty. How to do it is described in the article
Setting the screen orientation using config.txt
There are basically different ways to rotate the screen output. One possibility is to set the screen orientation in the configuration of your RaspberryPi.
To do this, connect to your RaspberryPi and open the configuration file with the following command.
sudo nano /boot/config.txt
In the opened configuration file you now have to navigate with the arrow keys to the lower end of the file.
Once there, you insert the following line.
But be careful: The value you set here determines the rotation of the display. The setting “display_rotate = 2” means that the screen content is rotated by 180 °. For other angles you have to set this parameter according to the table below.
As soon as you have chosen the setting correctly, you can save the configuration file with the key combination CTRL-X, then Y and Enter.
Now you only have to restart your RaspberryPi and your screen content should be rotated accordingly. 🙂
I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂
P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂