Coder Social home page Coder Social logo

Screen rotation about lcd-show HOT 29 CLOSED

goodtft avatar goodtft commented on August 18, 2024
Screen rotation

from lcd-show.

Comments (29)

goodtft avatar goodtft commented on August 18, 2024 11

How to modify the display orientation

  1. GPIO interface type LCD rotating display method:
    Suitable for GPIO interface type LCD (2.4” 2.8”3.2” 3.5”).
    Run command at Terminal:
    sudonano /boot/config.txt
    if you are using 2.4”, 2.8”or 3.2”, then find line “dtoverlay=tft9341”and add rotate parameter value as format following:
    dtoverlay=tft9341:rotate=value
    if it is LCD 3.5”, then find line “dtoverlay=tft35a” and add rotate parameter value as format following:
    dtoverlay=tft35a:rotate=value
    Take LCD 3.5”as example:
    To rotate 0 degrees (vertical screen display), the corresponding parameter value:
    dtoverlay=tft35a:rotate=0
    To rotate 90degrees (horizontal screen display), the corresponding parameter value:
    dtoverlay=tft35a:rotate=90
    To rotate 180degrees (vertical screen display), the corresponding parameter value:
    dtoverlay=tft35a:rotate=180
    To rotate 270degrees (horizontal screen display), the corresponding parameter value:
    dtoverlay=tft35a:rotate=270
    Press Ctrl + X, choose Y, save and exit; and re-start to achieve..

from lcd-show.

VivienGiraud avatar VivienGiraud commented on August 18, 2024 11

Adding this:

        Option "InvertY" "true"
        Option "InvertX" "true"

To /etc/X11/xorg.conf.d/99-calibration.conf
Just before EndSection
I tried it with mine (Kuman 3.5") and it worked :D

from lcd-show.

dbvandy avatar dbvandy commented on August 18, 2024 10

this saved my sanity... both fixes worked...

This setting in /boot/config.txt
dtoverlay=tft35a:rotate=270

and

/etc/X11/xorg.conf.d/99-calibration.conf
Option "InvertY" "true"
Option "InvertX" "true"

PERFECT! Thanks!

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024 3

Not intuitive at all. The documentation is pathetic. Sorry, goodtft, but it is true.

I started with a fresh raspbian install and LCD-show from github. I stood the display up such that the power chord and HDMI adapter are pointing up (the way I want it when I deploy it). This setting in /boot/config.txt worked for me:

     dtoverlay=tft35a:rotate=270

I observed:

rotate=0 top of screen is at physical left
rotate=90 top of screen is at physical bottom (up-side down)
rotate=180 top of screen is at physical right
rotate=270 top of screen is at physical top (right-side up)

It matters not what the contents of /etc/X11/xorg.conf.d/99-calibration.conf are. I left the file as it was installed except following the touch-screen calibration instructions.

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024 3

My entire Raspberry Pi 2 /boot/config.txt after filtering out all of the comment lines:

dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtparam=audio=on
dtoverlay=tft35a:rotate=270

Before on settling on rotate=270, I experimented with rotate values and observed the following:

	rotate=0           start of display area is at physical left
	rotate=90         start of display area is at physical bottom (up-side down)
	rotate=180       start of display area is at physical right
	rotate=270       start of display area is at physical top (right-side up)

I used the supplied goodtft program for calibration. I did not hand-edit any calibration parameters in /etc/X11/xorg.conf.d/99-calibration.conf. Here is the final file for me:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3936 227 268 3880"
        Option  "SwapAxes"      "1"
    Option "InvertY" "true"
    Option "InvertX" "true"
EndSection

Then, sudo reboot.

Good luck.

from lcd-show.

moppymopperson avatar moppymopperson commented on August 18, 2024 1

@VivienGiraud and @texadactyl This helped me out a lot! Thank you for documenting your solutions!

from lcd-show.

deanfantastic avatar deanfantastic commented on August 18, 2024

Does this also rotate the touchscreen as currently, I'm using:
dtoverlay=piscreen,speed=16000000,rotate=270 which rotates the display but not the touchscreen

from lcd-show.

VivienGiraud avatar VivienGiraud commented on August 18, 2024

@deanfantastic It won't works as it's not the same SPI interface, if I found a solution I will post it here :)

from lcd-show.

deanfantastic avatar deanfantastic commented on August 18, 2024

Thank you.

from lcd-show.

VivienGiraud avatar VivienGiraud commented on August 18, 2024

These links might help you:
https://www.raspberrypi.org/forums/viewtopic.php?t=143581
https://ubuntuforums.org/archive/index.php/t-1493407.html
Please keep us in touch if it works, I don't have a piScreen so I can't test.

from lcd-show.

deanfantastic avatar deanfantastic commented on August 18, 2024

Oh I'm not using a PiScreen, some kind of knock-off.

Tried all the above with SwapAxes and SwapXY but neither were effective.

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "MinX"  "3652"
        Option  "MaxX"  "62360"
        Option  "MinY"  "61728"
        Option  "MaxY"  "5342"
        Option  "SwapXY"        "1"
EndSection

and

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "MinX"  "3652"
        Option  "MaxX"  "62360"
        Option  "MinY"  "61728"
        Option  "MaxY"  "5342"
        Option  "SwapAxes"        "1"
EndSection

from lcd-show.

VivienGiraud avatar VivienGiraud commented on August 18, 2024

Yeah it didn't works, you should try my solution.
Adding this:

        Option "InvertY" "true"
        Option "InvertX" "true"

from lcd-show.

VivienGiraud avatar VivienGiraud commented on August 18, 2024

On my side it works flawlessly !

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

Viv, please publish your config.txt setting for dtoverlay=tft35a parameter and the entire /etc/X11/xorg.conf.d/99-calibration.conf contents.

Thanks.

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

My screen display orientation was solved. But, my touchpad was inverted when I used one of my Tk applications and the desktop in general. Viv's solution worked for me.

goodtft, your documentation sorely needs a refresh.

from lcd-show.

VivienGiraud avatar VivienGiraud commented on August 18, 2024

@texadactyl Sorry for being late, really happy if my solution worked for you! You can close this one, and if you think documentation needs a refresh please open a new one with info related to.
Anyway I'm happy it works for you now, I'm really having funny with so, yeah! have fun with it too!

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

deanfantastic was the originator and, therefore, should close it. I don't know if this person has resolved their issues.

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

Okay, I suspect that deanfantastic lost interest in the thread he started. I tried to close this issue but I am not permitted to.

from lcd-show.

dromer avatar dromer commented on August 18, 2024

There is no way to invert the x and y for the framebuffer?
I really don't want to use xorg, just with ie. pygame on a framebuffer.
plox

from lcd-show.

carpajr avatar carpajr commented on August 18, 2024

Is it possible to reopen this issue?

I'm trying to rotate touchscreen of tft35a using an eglfs application but didn't work. Even using EVDEV or TSLIB params.

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

@carpajr If you want assistance, you have to provide more details than "didn't work". WHAT is going wrong? Rotated screen? Unexpectedly zoomed in or out? What specific remedies have you tried?

By the way, this vendor will provide no solution for you. It's up to you to figure it out like everyone else in this stream of messages. My messages describe what I did to make it work on an RPi. My project for RPi and this TFT is here, for whatever it is worth: https://github.com/texadactyl/rpi_clock

Also see @dbvandy commented on Jan 29, 2018 who seems to have done the same thing as me.

Trial and error! (=:

from lcd-show.

carpajr avatar carpajr commented on August 18, 2024

@texadactyl, sorry. I've started to write and forgot to explain what happens.

I tried several ways to touchscreen work and these boot/config.txt lines were effective:
dtoverlay=tft35a:rotate=270
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900
dtoverlay=w1-gpio-pullup,gpiopin=4,extpullup=1

However, set up the screen rotation became a real challenge for eglfs applications. I tried several modifications in dtoverlay and decided to use ts_calibration, but also didn't work.

QT_QPA_FB_TSLIB=1
TSLIB_FBDEVICE=/dev/fb0
TSLIB_TSDEVICE=/dev/input/event0
TSLIB_CALIBFILE =/etc/pointercal

So, I tried to use ev_dev with some parameters, but once again, didn't work. The rotation configuration doesn't work.
QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=270 or 90

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

I have no file called "/etc/pointercal" on my RPi. I am using Raspbian. What are you using?
uname -a:
Linux rpiclock 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

My app is not based on QT. Instead, I am using Tk/tkinter to access the TFT.

from lcd-show.

carpajr avatar carpajr commented on August 18, 2024

@texadactyl,
I'm using Raspbian, but not using X11 or any windows system. The application that I'm developing runs over EGLFS (OpenGL) and that is why it is harder to do the touchscreen rotation. I didn't find any tip for fix this.
I have not any problem using two other displays (7" resistive and 10" capacitive), but the tft35a seems a lost cause. :(

from lcd-show.

texadactyl avatar texadactyl commented on August 18, 2024

You will have a challenge to train EGL and OpenGL in using goodtft hardware. This TFT vendor supports only Xorg in combination with their custom Xorg code.

You probably have seen this: https://doc.qt.io/qt-5/embedded-linux.html

from lcd-show.

carpajr avatar carpajr commented on August 18, 2024

I didn't know about the limitation when I bought the display, but life is short to complain about that. :)

Yes, I saw the docs. There are some tricks to set up a touch, but none of them worked with tft35a.

from lcd-show.

alidevecioglu avatar alidevecioglu commented on August 18, 2024

Not intuitive at all. The documentation is pathetic. Sorry, goodtft, but it is true.

I started with a fresh raspbian install and LCD-show from github. I stood the display up such that the power chord and HDMI adapter are pointing up (the way I want it when I deploy it). This setting in /boot/config.txt worked for me:

     dtoverlay=tft35a:rotate=270

I observed:

rotate=0 top of screen is at physical left
rotate=90 top of screen is at physical bottom (up-side down)
rotate=180 top of screen is at physical right
rotate=270 top of screen is at physical top (right-side up)

It matters not what the contents of /etc/X11/xorg.conf.d/99-calibration.conf are. I left the file as it was installed except following the touch-screen calibration instructions.

It's working thank you 😃👍

from lcd-show.

fisher1977 avatar fisher1977 commented on August 18, 2024
    Option "InvertY" "true"
    Option "InvertX" "true"

It's working fine. thx

from lcd-show.

DjiZoN avatar DjiZoN commented on August 18, 2024

Option "InvertY" "true" Option "InvertX" "true"

Thanks You Work Find.

Option "SwapAxes" "1" or "0"
this option for just accepted of invert orientation?????

from lcd-show.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.