Code: Select all
sudo nano /boot/config.txt
Code: Select all
$ sudo apt-get install xinput
Code: Select all
xinput --list
Code: Select all
DISPLAY=:0 xinput --list
Code: Select all
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
Cool! You're doing a great job. I started playing around with Rasp Pi knowing nothing and now—well, I know a little bit.twuelfing wrote:I was referred to this thread while attempting to get my raspberry pi with the 7 inch official touch screen to rotate the display AND touch screen 90 or 270 degrees.
I am very inexperienced with raspberry pi, Linux, etc. and could use some help.
I followed the directions until I ran the command in the image below and the results confused me.
I would greatly appreciate any expertise or ideas anyone may have.
Thanks,
Code: Select all
sudo nano /boot/config.txt
Code: Select all
display_rotate=1
Code: Select all
display_rotate=3
Code: Select all
sudo reboot
Code: Select all
FT5406 memory based driver
Code: Select all
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
Code: Select all
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
Code: Select all
sudo nano /etc/rc.local
Code: Select all
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
Code: Select all
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
Code: Select all
@/your/script.sh
Code: Select all
#!/bin/bash
#script to set correct touchscreen orientation after x start
#this won't rotate the displayed image, only the touchscreen input
#to rotate the displayed image add the following to /boot/config.txt
#"display_rotate=1" to rotate display 90 degrees
#"display_rotate=3" to rotate display 270 degrees
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
#Uncomment this for 90 rotation
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
#Uncomment this for 270 rotation
#xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
Really helpful post thanks!lanewinfield wrote:Code: Select all
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
Code: Select all
added "display_rotate=2" to /boot/config.txt
(run via ssh so)
DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 0
DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 1
DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 0
They are for the xinput program to identify the ASCII characters are meant as a command, many of command line programs use the minus sign (or two) to identify user argument or command. Try several commands with --help and see what you get. e.g.twuelfing wrote:Forgive my ignorance here,
I have just been following the directions provided here and dont really understand what all of it is doing or why it does it, so I am going to ask.
What do the two hyphens or minus signs before the set-prop part of the command?DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 0
Code: Select all
ls --help
This is weird. I am not a Linux guru so take my writings with grain of salt.twuelfing wrote:thanks for the info.
I noticed that if i include the two dashes when i do the command manually it does not work. The commands only seem to work if i omit those.
any reason that would be the case?
mjlush wrote:lanewinfield wrote:
In my hands I ended up doingQuite why our Pi's would differ like that I really don't know (am running up to date rasbian and rpi-update)Code: Select all
added "display_rotate=2" to /boot/config.txt (run via ssh so) DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 0 DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 1
If you're going to rotate it 180deg then you should use lcd_rotate=2 in config.txt rather than display_rotate. That will rotate the touchscreen along with the display and you don't need any xinput commands. The problem being discussed is rotating the screen 90deg (1) or 270deg (3) which requires the xinput commands to orient the touchscreen correctly.mjlush wrote:
Really helpful post thanks!
In my hands I ended up doingQuite why our Pi's would differ like that I really don't know (am running up to date rasbian and rpi-update)Code: Select all
added "display_rotate=2" to /boot/config.txt (run via ssh so) DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 0 DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 1
Code: Select all
sudo chmod 755 /etc/xdg/lxsession/LXDE-pi/screenflip.sh