This indicates that the x and y axes of the touchscreen are swapped. To correct this, we need to swap the x axis for the y axis. Press Ctrl-X then Y to exit nano and save the changes, then enter sudo reboot to reboot the Pi. Now if you drag your finger around the screen, you will notice that the y axis up and down is correctly aligned with the motion of your finger. However, the x axis left and right is still inverted. To fix this, we need to install two more kernel modules, xinput and evtest.
Install the utilities by entering sudo apt-get -y install xinput evtest at the command prompt:. Now add this code above the. After the Pi finishes rebooting, you should notice that when you move your finger across the touch screen, the pointer should follow correctly in both axes. If you are using the Raspberry Pi 2 Model B, you will need to complete the calibration steps below before the pointer follows your finger correctly and make sure that you have enabled startx to load automatically — see step 6 in this article.
You can rotate the screen 90 degrees as we did in this tutorial and the power connector will be at the bottom of the screen, but you can also rotate it degrees so that the power connector is at the top of the screen. All you need to do is switch the values of the 0 and 1 at the end of this line.
Now that we have our LCD touchscreen up and running, the final step in the installation is the calibration of touch control. This will make the pointer much more accurate and easier to use. This process needs to be done using super user root privileges. Enter sudo su at the command prompt to enter root mode:. Install the tslib library by entering aptitude install libts-bin :.
See here for information about configuring ts. The program will consecutively display five crosses on different parts of the screen, which you need to touch with as much precision as possible:. Drag the cross around the screen and observe how closely it follows your finger or stylus to test the accuracy of the calibration. Now enter sudo reboot at the command prompt to reboot, and you should be all set to explore the Raspbian desktop on your LCD touch screen!
This is kind of a long process, but it is well worth it if you want to get the LCD touchscreen set up properly. So if you have any trouble setting this up or have anything to say, please leave a comment below.
Also, if you found this article useful, please share it with your friends! What screen are you using? Thanks for these great step for step instructions.
I followed completely. I tried several Times, but it stays contrary. When calibrating, everything is fine and looks good, but not after reboot. Would be great if you could help me to bring it to work. Thanks for a great how-to, the image I got with my screen has never even booted successfully but your guides have got me up and running with my Waveshare 3.
It would be great to get the buttons working and the backlight turning on and off with the shutdown command. Please let us know if you find out how! Buttons can be accessed directly via GPIO. On my WaveShare SpotPear v4 these are pins 12,16 and Hi I use the Waveshare 3.
I am an absolutly noob i have no idea whats happen. As I understand you need to run test directly on the rasbpi, typing that command through attached Keyboard.
As when you run test from putty it will do scan for your computer monitor. In my case when I ran calibration from rasbpi directly, it show screen for few second with cross moving around and finish. Though when I run startx, it respond to touch correctly. To protect against this, use this export :. Perhaps my display is faulty.
Even better do it by-id which gives even clearer names. When I start simple python program that create window with buttons from command prompt, I get error.
Is there a way to switch back to HDMI without undoing all the changes? I have gotten my Pi2 working with the waveshare via this and the other tutorial. I would like to setup some things with a full display and then use the TFT screen for more mobile things. I make the same mistake at first and then copy the line by selecting all. Overview 2. Release Specific 3. Foundational Components 4. Industrial Protocols 5. Examples and Demos 6. How to Guides 6.
Host 6. Previously written parameters can be retrieved at any time using the readCalibration function calibration parameters are always read when the class is instantiated. Use this function instead of mouseChanged whenever a mouse event occurs.
The filter's size can be manipulated using the setFilterSize function. Create an instance of the QWSPointerCalibrationData class, fill in the device and screen coordinates and pass that object to the mouse driver using this function. See also clearCalibration and transform. Clears the current calibration, i. See also writeCalibration. Notifies the system of a new mouse event after applying a noise reduction filter.
SGbo SGbo 6 6 silver badges 17 17 bronze badges. Add a comment. Active Oldest Votes. I found a solution myself. Here's how I did it. The Overflow Blog. Podcast Helping communities build their own LTE networks.
0コメント