Invert Y Axis for touch screen

Hey Guys,

Have just purchased 2x Advantech touchscreens for a project at work. These will have a raspberry pi as the backend, everything works out of the box which is great… except the Y axis is inverted!

All my googling and trial and error has left me more confused than when i started.

I’ve tried making a config file for /etc/X11/xorg.conf.d/99-calibration.conf using the output of a touchscreen calibration, i’ve modified config files in /usr/share/X11/xorg.conf.d and i’ve played with settings in /boot/config.txt.

If anyone has experienced similar issues and has found a fix or if you have something else for me to try, please let me know.

3 Likes

Hi Matthew,

Every display manufacturer goes about handling screen rotation and touch sensor rotation a little differently but typically it’s either an X11 config or config.txt option that needs to be tweaked.
It’s worth mentioning the display and touch orientation are usually separate so you can end up with one rotated and not the other.

Can you provide a link to the Advantech touchscreens you are using or any documentation for them so we can see what they’re expecting?

1 Like

Hi Matthew,

To add to Trent’s reply, some people with SPI displays have used co-ordinate matrices to invert their touch, is that what you’re doing?

https://wiki.ubuntu.com/X/InputCoordinateTransformation

-James

1 Like

Hi James,

This is the touchscreens we’ve purchased.

Havent played around touch matrices and the like previously, so this is not something i’ve attempted.

1 Like

Hi Matthew,

Not much information to be found there from the manufacturer on display rotation.
Which Raspberry Pi board version were you using? The video drivers are different between the Pi 3 and Pi 4 so they require different commands to configure.
I’ve just grabbed a Pi 4 on the bench and tested the “inverted” option from the built in Pi screen configurator but it is a 180 degree rotation, it does not flip the axis. Just to be clear were you looking to rotate the display 180 degrees or mirror it across the Y axis?

1 Like