Rotating Waveshare 10.1 display on Raspberry Pi
I recently used a Waveshare 10.1 inch display on a Raspberry Pi as a vertical touch display. And it wasn’t too easy to rotate the screen and the touch functionality.
First of all we rotate the display functionality. Therefore we update the config.txt
sudo nano /boot/config.txt
Set the value for „display_rotate“ to „1“, which means 90 degress rotation. A value „2“ would be 180°, „3“ for 270°.
Create calibration file
We need to have a display calibration file. This LCD can be calibrated using a program called xinput_calibrator which can be downloaded from Xinput-calibrator_0.7.5-1_armhf (download it from waveshare website). Extract and copy the software Xinput-calibrator_0.7.5-1_armhf.deb to the Raspbian of your Pi.
Install it with the commands:
sudo dpkg -i -B xinput-calibrator_0.7.5-1_armhf.deb
This will add a new Menu item in your Desktop menu. Click the „Menu“ button on the task bar, choose „Preference“ and „Calibrate Touchscreen“. Finish the touch calibration following the prompts. The result need to be saved the the following file:
Add an option Block to this file like this:
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
Make sure you have the latest version of Raspian installed. Otherwise use this to update your system:
sudo apt-get update
sudo apt-get upgrade
Download the drivers LCD-show-180331.tar.gz
- Download the Raspbian / Ubuntu Mate image from Raspberry Pi website and extract it on a PC.
- Copy the LCD driver to the micro SD card (or copy the driver to the system of Pi using a USB drive).
- Append the following lines to the config.txt file which is located in the root of the card:
hdmi_cvt 1024 600 60 6 0 0 0
- Extract the driver files within /boot/
tar xzvf /boot/LCD-show-*.tar.gz
chmod +x LCD101-1024x600-show
- run the screen script to initialise
- finally reboot the Raspberry Pi