Now there is one more change to be made to the touchscreen parameters.
Create a new file, the only important thing here is that you create a .sh file
so that it can be executed in the autostart (In our example the file is
called fliptouch.sh, but the name can be freely chosen by you). The
location is up to you (In our example we use /home/pi/Desktop).
Now open the file and insert the following:
For the rotation normal you need to use the following command:
For the rotation le you need to use the following command:
For the rotation right you need to use the following command:
For the rotation inverted you have to use the following command:
The last thing that is missing is that this calibration is done automatically
aer every reboot or every new startup of your Raspberry Pi. In order not
to have to enter this manually every time, execute the following
commands in the specified order to put the file with your calibration
command into the autostart.
This command makes the selected file executable (be sure to use your
location and its filename here).
This command puts your file into the autostart.
Add the following at the end (Again, be sure to use your location and file
name).
Save the file with CTRL+O and close it with CTRL+X.
xinput --set-prop 'List object with ID6' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 0
xinput --set-prop 'List object with ID6' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
xinput --set-prop 'List object with ID6' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1
xinput --set-prop 'List object with ID6' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
sudo chmod 777 /home/pi/Desktop/fliptouch.sh
sudo nano /etc/xdg/lxsession/LXDE/autostart
@/home/pi/Desktop/fliptouch.sh
Now you have to write this into another file.
Again, write the line at the end of the file and save the file with CTRL+O and
then close it with CTRL+X.
The last thing you need to do is reboot your Raspberry Pi.
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
sudo reboot