2020-11-05 03: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.
2020-11-12 05: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
2020-11-08 09:39 PM
Hello,
Two possible reasons :
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
2020-11-09 05: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
2020-11-09 05:19 AM
One more question. Where to change so that the minutes do not change every second and the analog clock changes?
best regards
2020-11-09 06: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
2020-11-10 02:08 AM
Hi
Thank you. This is what I ment.
best regards
Andrzej
2020-11-10 07: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
2020-11-12 05: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