Datasheet
You can do this if the calibration on the screen isn't to your liking or any time you change the rotate=XX module
settings for the screen. Since the screen and touch driver are completely separated, the touchscreen doesn't auto-
rotate
Download and compile it with the following:
You must be running PIXEL (the GUI) while calibrating.
Before you start the calibrator you will need to 'reset' the old calibration data so run
DISPLAY=:0.0 xinput set-prop "stmpe-ts" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
Now you'll have to run the calibrator while also running X. You can do this by opening up the terminal program and
running the the xtcal command (which is challenging to do on such a small screen) OR you can do what we do which is
create an SSH/Terminal shell and then run the calibrator from the same shell, which requires the following command:
DISPLAY=:0.0 xtcal/xtcal -geometry 640x480
Note that the geometry may vary!
If you are using a 2.4"/2.8"/3.2" 320x240 display with landscape orientation, use 640x480. If you're in portrait, use
480x640.
If you are using a 3.5" display with landscape, use 720x480, portrait is 480x720
Follow the directions on screen
Once complete you'll get something like:
sudo apt-get install libxaw7-dev libxxf86vm-dev libxaw7-dev libxft-dev
git clone https://github.com/KurtJacobson/xtcal
cd xtcal
make
© Adafruit Industries https://learn.adafruit.com/adafruit-2-4-pitft-hat-with-resistive-touchscreen-mini-kit Page 26 of 63










