Logo Logo
Back to list
Razno

How to Rotate the Screen on Raspberry Pi

14. 03. 2026
How to Rotate the Screen on Raspberry Pi

When working on Raspberry Pi projects, you often need to rotate the screen by 90 or 180 degrees due to the physical mounting in the case. The process varies slightly depending on whether you are using an older model (RPi 3) or a newer one (RPi 4/5).

Raspberry Pi 3 and Older Models

  1. Open the config.txt file:
    sudo nano /boot/config.txt
  2. Add the rotation line to the end of the file (0=normal, 1=90°, 2=180°, 3=270°):
    lcd_rotate=2
  3. Save (Ctrl+O) and reboot: sudo reboot

If the above method doesn't work, try using the xrandr command in the desktop environment:

sudo chmod 644 /etc/xdg/lxsession/LXDE-pi/autostart
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Add the following line: @xrandr --output DSI-1 --rotate inverted

Raspberry Pi 4 and Newer Models

Newer models use a different graphics driver (KMS), so the file path has changed:

  1. Edit the configuration file:
    sudo nano /boot/firmware/config.txt
  2. Change the line dtoverlay=vc4-kms-v3d to:
    dtoverlay=vc4-fkms-v3d
  3. Add lcd_rotate=2 to the end of the file and reboot.

If it still doesn't work, use the same autostart method with the xrandr command as described above.

Hvala za obisk! Dodajam politiko zasebnosti.

© 2024 Vse pravice pridržane.

Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.