TheRiflesSpiral
Posts: 15
Joined: Tue Jan 03, 2017 8:11 pm

Portrait orientation, official 7" touchscreen display?

Tue Jul 31, 2018 1:41 pm

Good morning,

I'm able to rotate the display 180° using "lcd_rotate=2" in the /boot/config.txt file. When I try values of "1" or "3", however, I can't get a 90° or 270° rotation.

Is it possible, (perhaps through other means, if not supported with lcd_rotate) with the official 7" touchscreen display, to get a portrait orientation?

Thanks!

aBUGSworstnightmare
Posts: 857
Joined: Tue Jun 30, 2015 1:35 pm

Re: Portrait orientation, official 7" touchscreen display?

Tue Jul 31, 2018 2:11 pm

lcd_rotate will not work as this uses reverse-scan functionality from the displays timing controller (refer to this for Details viewtopic.php?f=108&t=135364&p=1346853#p1293526).

Use display_lcd_rotate (or display_rotate) instead. Be aware of the viewing angles

Code: Select all

Viewing angle (degrees): 
Top - 50
Bottom - 70
Left - 70
Right - 70
You might not be happy with the results in portrait mode.

TheRiflesSpiral
Posts: 15
Joined: Tue Jan 03, 2017 8:11 pm

Re: Portrait orientation, official 7" touchscreen display?

Tue Jul 31, 2018 5:24 pm

Thank you, aBUGSworstnightmare. The scan direction swap is an elegant solution to 180 rotate. It makes sense that it wouldn't work in a 90° rotate since the video adapter likely only scans in one direction.

The display_lcd_rotate option did rotate the display appropriately but predictably did not adjust touch input to match the screen orientation. However I was able to use xinput to adjust the coordinate transformation matrix to match.

For anyone trying Portrait Orientation (90 degree right rotation) in X on the Official Foundation 7" LCD touchscreen in Rasbian Stretch:

In /boot/config.txt add the line:

Code: Select all

display_lcd_rotate=1
Create a new bash script called swapmouseaxis and put it in ~/ (don't forget to make it executable)

Code: Select all

#!/bin/bash

xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1/sw
Now edit /home/pi/.config/lxsession/LXDE-pi/autostart to add a call to the script by adding this line to the end:

Code: Select all

@sh /home/pi/swapmouseaxis
If you're testing the xinput command in an SH session, you'll need to add "DISPLAY=:0" in order to select the correct local display.

TheRiflesSpiral
Posts: 15
Joined: Tue Jan 03, 2017 8:11 pm

Re: Portrait orientation, official 7" touchscreen display?

Tue Jul 31, 2018 6:14 pm

I should have mentioned; in my specific application, a better viewing angle top/bottom is one of the reasons I wanted to swap the orientation.

My users are likely to be taller/shorter but standing directly in front of the screen. Left/right doesn't matter in this case. Since the screen is in an orientation where there's 70° of viewing angle (140° total) it works out nicely.

Return to “Official Foundation Display”

Who is online

Users browsing this forum: No registered users and 2 guests