Some projects require the display and touch to be rotated 90 degrees or other rotations.
Rotating 90 degrees (or others) requires a different line to be added to the config file:
Open the config.txt file by using the following command in a terminal window:
sudo nano /boot/config.txt
Then add the line that best fits your needs:
- Rotate left 90 = xinput set-prop 'raspberrypi-ts' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
- Rotate 180 = xinput set-prop 'raspberrypi-ts' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
- Rotate right 90 = xinput set-prop 'raspberrypi-ts' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
- Return to upright = xinput set-prop 'raspberrypi-ts' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1