Display manager!

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 886
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 771 times
Been thanked: 190 times

Flowcode v11 Display manager!

Post by jgu1 »

Hi!

I have played with one of the examble with Display manager. I have converted the display a ST7796 and the Touch to XPT2046 and the device to an ESP32 dev1. It work in simulation but I can´t compile to the target, get lot of error.

Any advice please? ;)

Br Jorgen
Attachments
Touch screen control_selv_ESP.fcfx
(41.92 KiB) Downloaded 15 times
Touch screen control_selv_ESP.msg.txt
(1.22 KiB) Downloaded 21 times

BenR
Matrix Staff
Posts: 2048
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 544 times
Been thanked: 727 times

Re: Display manager!

Post by BenR »

Hi Jorgen,

Investigating for you now. The msg.txt file seems to be truncated so trying to replicate for myself.

BenR
Matrix Staff
Posts: 2048
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 544 times
Been thanked: 727 times

Re: Display manager!

Post by BenR »

The problem is caused by the XPT2046 component pin properties.

If you change $GPIO5 to $PortA.5 by clicking on the pin property and ticking the Use chip references check box then hopefully that should resolve the issue.

The $GPIO5 will work when it's used as a generic I/O pin but not currently when that is tied to a peripheral e.g. SPI.

So the XPT2046 MOSI, MISO and CLK pins will all currently need to use the chip referenced pin property types.

Here's your program adjusted so that it's now compiling correctly.
Touch screen control_selv_ESP.fcfx
(41.94 KiB) Downloaded 21 times

jgu1
Posts: 886
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 771 times
Been thanked: 190 times

Flowcode v11 Re: Display manager!

Post by jgu1 »

Hi Ben!

I can compile now, fine, thank you, and it work. But If I rotate the display to pos.1, all the Widget rotate as they should on the display, but the XPT2046 doesn´t follow the rotation. The touch is working outside the Widget and same area as without the rotation.

Also in simulation, how can I rotate the XPT2046 in FC11. In FC10 the touch follow the rotation?
Attachments
Touch screen control_selv_ESP.fcfx
(41.93 KiB) Downloaded 19 times

medelec35
Valued Contributor
Posts: 2210
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 674 times
Been thanked: 754 times

Re: Display manager!

Post by medelec35 »

Hi Jorgen.
With the display:
You will need to set the Orientation within display properties to either 1 or 3.
That will set display simulation orientation.

For hardware orientation, you will need to drag display SetDisplayOrientation function to match the properties value either 1 or 3

As for the XPT2046, I'm not sure to be honest Ben might know.
I think to make it easier either an orientation function requires adding as getting it to check there orientation might not be possible?
Martin

jgu1
Posts: 886
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 771 times
Been thanked: 190 times

Flowcode v11 Re: Display manager!

Post by jgu1 »

Hi Martin!

Thank´s for answer.
As you can see in my attached program, I have set the rotation to 1. The text and other display elements rotate correctly, but the XPT2046 does not follow the rotation, it is possible to test in simulation and same in "real world".

I have previously used this (rotation)in Flowcode 10 with XPT2046, where I did not have any issues with this behavior. I am not sure whether this is a bug in Flowcode 11 or if I am missing something. As you mentioned, Ben might know. :D
Br Jorgen

BenR
Matrix Staff
Posts: 2048
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 544 times
Been thanked: 727 times

Re: Display manager!

Post by BenR »

Hello,

The other touch components have their own SetOrientation macro to allow the coordinates to be remapped for rotation but this seems to have been missed for the XPT2046.

edit: The function should be available for you now via the Library Updates.

jgu1
Posts: 886
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 771 times
Been thanked: 190 times

Re: Display manager!

Post by jgu1 »

Thank you Ben, I will test and you hear. Merry Christmas. :D

Jorgen

jgu1
Posts: 886
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 771 times
Been thanked: 190 times

Re: Display manager!

Post by jgu1 »

Hi Ben!
I can now rotate the touch function on the display and the positions are correct. However, when I use the slider, it seems to split it up, and on some of the other widgets it draws a line through them. Unfortunately, the rotation for the XPT2046 does not work in the simulation, only in rotation 0
Am I missing something, please?
Br Jorgen
Attachments
Touch screen control_selv_ESP.fcfx
(43.91 KiB) Downloaded 8 times
IMG_0147_400kb.jpg
IMG_0147_400kb.jpg (67.67 KiB) Viewed 87 times
IMG_0145_400kb.jpg
IMG_0145_400kb.jpg (69.1 KiB) Viewed 87 times

BenR
Matrix Staff
Posts: 2048
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 544 times
Been thanked: 727 times

Re: Display manager!

Post by BenR »

Hello,

To get the simulated coordintes correct simply go into the gLCD properties and scroll down to the bottom. Under simulation change the Physical orientation to match that of your hardware and then hopefully the display will re-orient itself on the panel and the simulated touch will work correctly again.

I'll look into why the slider is not redrawing itself correctly. It should be efficient and only draw the pixels that change and that works perfectly on other displays so my theory is it's something to do with the drawing routines for the specific display component you're using so I'll start the search there.

Edit - I've pushed an update now that hopefully should make a difference for the slider corruption.

Post Reply