im sure alot of people are wondering the same question but how do you use timer i want to do a count down timer from 1 hour counting down each seconds in 00:00 time format and once it gets close to last 50 seconds i want it to be red so student feels pressurised its evil but its for their own benefit
You add a ātimerā component to your app.
You set it with a āIntervalMillisecond = 1000ā.
You set it as āenabled= FALSEā by default (in the Screen1.starts).
Then you have a Start button that, when clicked, will set ātimer.enabled=TRUEā, set a global variable to 3600, and set the colour of the label you want to use for display to not red (like labelTimer set color = black ; where black is the appropriate little colour tile in the Color menu in the Blocks mode).
Then, the block āwhen Timer fires doā will be called each second (because the timer has been enabled with a 1000 millisecond frequency) and in that block you will, in order,
- decrement the global variable by one
- take the value of the now decremented global variable to make a minute / second value (using division, floor and modulo functions) and show that in the timer display
- check if the global variable is 50 or less, in which case, it changes the colour of the display to red
All you need then may be ancillary buttons like āpauseā and āresetā if needed, that will have to fiddle with the timer enabled status, or change the start value, or whatever is needed.
You can have that up and running in less than an hourā¦