Skip to main content
ADębs.1
Senior
April 9, 2021
Solved

TouchGFX, STM32F746G-DISCO

  • April 9, 2021
  • 7 replies
  • 1691 views

Hi

I want to change the screen to another, but not with the button, but with the main.c command. how to do it?

Andrzej

This topic has been closed for replies.
Best answer by Romain DIELEMAN

A trick would be to use a fake button: in TouchGFX Designer go to the "interactions" tab and add an interaction with as trigger a fake "hardware button clicked" and for action "change screen". Then in your main when the appropriate value is accheived you do the backend animation process and call that gotoscreenname transition.

/Romain

7 replies

Alexandre RENOUX
Visitor II
April 12, 2021

Hello ADebs.1,

To do so, you need to use the MVP concept of TouchGFX to communicate with the backend. You need to go through the Model to communicate with main.c.

Please have a look at the documentation website :

Additionally, you will find an example code enclosed, using UART and exchanging information between main.c and TouchGFX.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

ADębs.1
ADębs.1Author
Senior
April 12, 2021

Thank you. In general, I know the concept and apply it. I mainly mean switching from screen to screen after the counter has reached the appropriate value without the need to press a button. I will analyze the proposal and give you an answer.

Romain DIELEMAN
ST Employee
April 12, 2021

Hi,

Have a look at the backend communication article in the documentation. It will help you understand how to communicate between the GUI and the main.c The common use of the backend communication is usually to communicate between the GUI and sensors, so it is the same idea.

Gustavo from ST made a video on this as well which could help you develop your project.

/Romain

ADębs.1
ADębs.1Author
Senior
April 12, 2021

Thank you. In general, I know the concept and apply it. I mainly mean switching from screen to screen after the counter has reached the appropriate value without the need to press a button. I will analyze the proposal and give you an answer.

Romain DIELEMAN
Romain DIELEMANBest answer
ST Employee
April 12, 2021

A trick would be to use a fake button: in TouchGFX Designer go to the "interactions" tab and add an interaction with as trigger a fake "hardware button clicked" and for action "change screen". Then in your main when the appropriate value is accheived you do the backend animation process and call that gotoscreenname transition.

/Romain