3

On a pi B with raspbian-stretch, I have tried every tip I could find to get the touch screen to rotate 180 degrees: commands in config.txt, new drivers, using ./LCD-show 180, and more. Nothing works except modifying the config command to Dtoverlay=tft35a:rotate=270.

However the touch functionality doesn't rotate along with the display.

Can anybody offer me a solution or, worst case, suggest a case that incorporates the display with the usb and ethernet ports on the right? I bought the very nice Astroprint case that puts the screen at a 45 degree angle.

Wilf
  • 2,533
  • 3
  • 23
  • 39
Andy F
  • 31
  • 2

2 Answers2

1

Add to config.txt:

lcd_rotate=3

This is presuming the LCD is attached by DSI ribbon cable. That should also rotate the touch coordinates too. 1 = 90° 2 = 180° 3 = 270°

https://www.raspberrypi.org/forums/viewtopic.php?t=166959

Andy Anderson
  • 649
  • 1
  • 4
  • 11
0

I think the touch part of the screen behaves as a different part (a input device) on top ot the display's output device. So you have currently just rotate the latter not the input

This suggest a similar concept - except the screen is rotated by adding this to /boot/cmdline.txt (you may be able to stick with your existing rotation command, in which case some of these options may need to be different!):

fbtft_device.rotate=X 

To actually change the touchscreen orientation, try changing swap_xy=0 to swap_xy=1 in /etc/modules (on the ads7846_device line).

Then follow by running sudo apt-get -y install xinput evtest, and adding this line:

DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 0

before the . /etc/X11/Xsession line in /etc/X11/xinit/xinitrc, and rebooting.

Again, you will lily require different parameters (it also suggests 0 1 at the end of the DISPLAY line).

These devices are general purposes when you have got the rotation working, it should help to calibrate the touch-screen as well! - this is also detailed in that article.

Wilf
  • 2,533
  • 3
  • 23
  • 39