Displaymanager new project!

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

Flowcode v11 Displaymanager new project!

Post by jgu1 »

Hi!

I am starting on a new project, using displaymanager. I have to be able to switch an output on and off by pressing a botton, and I have to create some more botton, this is only the start. As you see in Scene0 I have made two botton, in the beginning when I simulate borth botton was shown in the display on the 2D screen, also when I compile to chip and I was able to switch the output on and off by toggle the botton, but suddently the disapear from the 2D screen and when I touch the one botton both output switch on. What Have I done wrong please?

One wish more, how can I when I press one of the botton, change the bagground on the botton from red to green and the text also have to change to ON and when I press again go back to red bagground and the text OFF.

Hope for some help, thank´in advance :)

Br Jorgen
Attachments
On_OffDispmanager_S3.fcfx
(42.35 KiB) Downloaded 11 times
(view online)

BenR
Matrix Staff
Posts: 2321
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 645 times
Been thanked: 855 times

Re: Displaymanager new project!

Post by BenR »

Hi Jorgen,

Your first button toggles GPIO0.

Your second button also toggles GPIO0 and underneath the decision sets GPIO2.

To change the button colour you simply call the Button component macro ModifyColour with index 1 for the background colour and index 2 for the text colour. The Redraw parameter decides if the colour change is drawn immediately but this will remove the default text so might be better to just use the text set function to redraw after the colour change.

Here's an example.
Screenshot 2026-10-01 110018.png
Screenshot 2026-10-01 110018.png (84.14 KiB) Viewed 152 times

There is some wierdness for me on my home PC so I'm seeing if I can replicate with a fresh project.

You shouldn't need the while touched loop unless you never want repeat touches and the second check for touch in your main macro isn't needed. If you need longer delays between touches then instead increase the Touch Repeat rate property of the Display Manager component.
Untitled.jpg
Untitled.jpg (84.69 KiB) Viewed 152 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

jgu1
Posts: 965
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 897 times
Been thanked: 218 times

Re: Displaymanager new project!

Post by jgu1 »

Hi Ben!

Thank you very much for your quick reply. ;)

Yes, regarding the mistakes I made, I clearly wasn’t paying enough attention! :roll: I have now got the colours and text changing correctly, so I have learned something new.

However, as you can see, even though I have two buttons in Scene 0, only one of them appears in the display in the 2D panel. The same thing happens when I start the simulation.

When I compile the program and run it on the chip, the colour change and text work correctly, but the display is extremely slow. It also looks as if button 2 has somehow “exploded”. The actual button is not visible, but the text is scattered across the bottom of the display.

Am I doing something wrong again?

Jorgen
Attachments
One_Botton.png
One_Botton.png (175.27 KiB) Viewed 126 times
On_OffDispmanager_S3.fcfx
(43.24 KiB) Downloaded 4 times
(view online)

BenR
Matrix Staff
Posts: 2321
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 645 times
Been thanked: 855 times

Re: Displaymanager new project!

Post by BenR »

I've managed to dig in and find the cause of the missing button. Bizarrely it's to do with the specific background colour you've specified!

I've now fixed this in the component source, it was a very corner case issue with my serialised data parser. The first byte of the colour was matching up with a command code and corrupting the first item in the list.

I don't currently have access to my work PC so here's the file you can manually put into your "C:\ProgramData\MatrixTSL\FlowcodeV11\Components" folder.

DisplayManager.fcpx
(719.17 KiB) Downloaded 6 times
Hopefully this also fixes the second issue you're having.

I'll get this pushed to library updates tomorrow.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

jgu1
Posts: 965
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 897 times
Been thanked: 218 times

Re: Displaymanager new project!

Post by jgu1 »

I can now see the second button :) . But the display is still very slowly to update the button, but if I delete the changing bagground color and only change the text change color it is a little faster. In the buttons under the text a thin line is there in both button and on the right side of the buttons, it looks as if someone has bitten a piece off, or as if it has somehow broken.
If it is better for you, have a look when you are on the work PC if it is something you can fix
Jorgen

BenR
Matrix Staff
Posts: 2321
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 645 times
Been thanked: 855 times

Re: Displaymanager new project!

Post by BenR »

The line under and to the side is the drop shadow for touchable items. You can turn it off if you like.
Screenshot 2026-10-01 195403.png
Screenshot 2026-10-01 195403.png (20.7 KiB) Viewed 90 times
You could add a small rectangle on top of the button and change the colour of that. The smaller the area to redraw the faster it will be.
Screenshot 2026-10-01 195646.png
Screenshot 2026-10-01 195646.png (3.69 KiB) Viewed 90 times
I see you're using the fast SPI and the Fast pixel queue so I'm surprised it's as slow as you're saying. I'll check that the optimisations are in place for filling rectangles on that display.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

jgu1
Posts: 965
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 897 times
Been thanked: 218 times

Flowcode v11 Re: Displaymanager new project!

Post by jgu1 »

Hi Ben.

Once again, thank you very much for your help. That solved the problem with the line.

And thank you also for your detailed Display Manager videos on YouTube. I have watched them many times, and they have been very helpful.

I understand about the update speed of the buttons.

In the meantime, I changed the project yesterday so that the display has square corners instead of rounded corners, and I have almost finished it. I just need to create the programs for the last two buttons. Everything is working fine, and it looks really good on screen with the Display Manager :D

However, the “Compressor” button keeps toggling on and off by itself, but only on the hardware. Could this be something related to the S3 models? I experienced exactly the same thing in another project that I tried converting to an ESP32-DE1, and the problem disappeared there.

You are probably wondering why I don't simply use the ESP32-DE1, but I need the additional I/O available on the S3. ;)

Perhaps you could give me a suggestion for how I can eliminate these “ghost touches” when nobody is touching the screen?



**** EDIT: "ghost touch solved, I try i the Properties for the XPT2046 change the setting Analog mode from single end to differencial Solved my issue :D ****

Please update the last display manager component ;)

Many thanks again for your help.

Best regards,
Jørgen
Attachments
On_OffDispmanager_S3_Squere.fcfx
(57.2 KiB) Downloaded 3 times
(view online)

BenR
Matrix Staff
Posts: 2321
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 645 times
Been thanked: 855 times

Re: Displaymanager new project!

Post by BenR »

Hi Jorgen,

Excellent that sounds like great progress. The latest DM component is also now on the library updates system and I've added some new template files for the DM with more to come soon.

Shout if you need anything else :D
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

jgu1
Posts: 965
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 897 times
Been thanked: 218 times

Re: Displaymanager new project!

Post by jgu1 »

Thank you for the information, Ben. I’m looking forward to seeing the new features in Display Manager, and perhaps also a YouTube video introducing the new possibilities. ;) :lol:

Have a nice weekend.

Jorgen

Post Reply