Adafruit PiTFT touchscreen and X11

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
k6rtm
 
Posts: 39
Joined: Mon Aug 13, 2012 1:28 pm

Adafruit PiTFT touchscreen and X11

Post by k6rtm »

My PiTFT seems to work; I went through the hardware and software steps and it seems to fly. I've a metapicture up on my K6RTM twitter feed showing the Pi with PiTFT and Pi camera, the PiTFT showing an image taken by the Pi camera.

I've done both the touchscreen calibration sequences, in the order presented in the tutorial, the general one and then the X11 one, moving the X11 calibration parameters to the calibration file.

The next time I start X11, though -- cursor motion is mirrored on the screen! If I move the stylus to the left, the cursor moves to the right. If I move the stylus up, the cursor goes down -- and in the mirrored quadrant of the display! I've restarted, redone the calibration, gone through the software steps again, and everything looks as it should according to the tutorial.

So what did I do wrong?!? Where's the "flip these things over" switch I seem to have missed?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit PiTFT touchscreen and X11

Post by adafruit_support_mike »

What do you have in /etc/X11/xorg.conf.d/99-calibration.conf ?

User avatar
k6rtm
 
Posts: 39
Joined: Mon Aug 13, 2012 1:28 pm

Re: Adafruit PiTFT touchscreen and X11

Post by k6rtm »

/etc/X11/xorg.conf.d/99-calibration.conf contains:

Code: Select all

Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"stmpe-ts"
	Option	"Calibration"	"110 3737 3880 163"
	Option	"SwapAxes"	"1"
EndSection

User avatar
k6rtm
 
Posts: 39
Joined: Mon Aug 13, 2012 1:28 pm

Re: Adafruit PiTFT touchscreen and X11

Post by k6rtm »

The workaround for the cursor moving opposite to the stylus is as follows in /etc/X11/xorg.conf.d/99-calibration.conf :

Code: Select all

Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"stmpe-ts"
	Option	"Calibration"	"108 3748 3885 132"
	Option	"SwapAxes"	"1"
	Option	"InvertX"	"on"
	Option	"InvertY"	"on"
EndSection

Section "ServerLayout"
	Identifier "ServerLayout0"
	Option "StandbyTime" "0"
	Option "SuspendTime" "0"
	Option "OffTime" "0"
EndSection
The InvertX and InvertY entries take care of inverting those axes, correcting for the cursor moving opposite to the stylus on the touchpad.
SwapAxes swaps X and Y accounting for the rotation of the display.

The ServerLayout stuff works to keep the display from going dark after a period of inactivity; not quite there yet.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit PiTFT touchscreen and X11

Post by adafruit_support_mike »

You beat me to that section of the manual. Good find. ;-)

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”