STM32F746G-DISCO
I am studying 3 tutorial with clock.
When I select buttonSaveHour and buttonClock, times are not transferred to screen 2. When I return to screen 1, the hour is 00. Why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-05 3:12 AM
Hi
I am studying 3 tutorial with clock.
When I select buttonSaveHour and buttonClock, times are not transferred to screen 2. When I return to screen 1, the hour is 00. Why?
Yours sincerely
Solved! Go to Solution.
- Labels:
-
STM32F7 Series
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-12 5:33 PM
Please create a new thread for this since it's not directly related to the topic of this thread.
This is for others to be able to find it more easily.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-08 9:39 PM
Hello,
Two possible reasons :
- You haven't saved the values in the model
- You haven't retrieved in your ScreenView the values saved in the model. In this case you need to call a getter (you previously created) inside the setupScreen() function.
If you are following https://support.touchgfx.com/docs/tutorials/tutorial-03 and it does not work, you definitely did something wrong. Please carefully check what is mentioned in the tutorial.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 5:06 AM
Hi Alexandre
Thank you. I had a mistake in the name of the Save hour button function in TouchGFX Designer.
best regards
Andrzej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 5:19 AM
One more question. Where to change so that the minutes do not change every second and the analog clock changes?
best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 6:41 PM
I'm not sure I got your question right, but I'll try an answer.
If you do not want the minutes to change every seconds, then you need to change the condition with the tickCount.
Here is the code in the tutorial :
void Screen2View::handleTickEvent()
{
if (tickCount == 60)
{
minute++;
hour = (hour + (minute / 60)) % 24;
minute %= 60;
Unicode::snprintf(textClockBuffer1, TEXTCLOCKBUFFER1_SIZE, "%02d", hour);
Unicode::snprintf(textClockBuffer2, TEXTCLOCKBUFFER2_SIZE, "%02d", minute);
textClock.invalidate();
tickCount = 0;
}
One tick is 16 ms so if you reach tickCount = 60 then one second has passed.
If you want to have the minute value really change every minute, then you just write :
if (tickCount == 3600 /* 60x60 */)
I don't understand what you are trying to say regarding analog clock. Please be more precise.
When your question is answered, please close this topic by choosing Select as Best.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-10 2:08 AM
Hi
Thank you. This is what I ment.
best regards
Andrzej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-10 7:24 AM
He Alexandre
Still tutorial 3 with the clock.
1. How to transfer the current time to main.c after pressing Save hours? I have a secondTask.
2. How to remember the variable after power off?
regards
Andrzej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-12 5:33 PM
Please create a new thread for this since it's not directly related to the topic of this thread.
This is for others to be able to find it more easily.
/Alexandre
