rotate hdmi output raspberry pi code example
Example: rotate screen raspberry pi
# open the file /boot/config.txt, enter the line below and reboot.
display_rotate=0
#0=normal (upside up)
#1=rightside up
#2=upside down (or downside up)
#3=leftside up