Timers

Routine Summary

Calculates amount of time that passes.

Outputs

Ans

Variables Used

T, M

Calculator Compatibility

TI-84/+/SE

Author

Timothy Foster

:Pause "Timer Ready
:startTmr→T
:Repeat getKey
:Output(4,8,checkTmr(T
:End
:ClrHome
:checkTmr(T→T
:iPart(Ans/60→M
:T-60Ans→T
:{M,Ans

This simple routine counts up from when you press Enter and stops when you press any button. This program calculates the amount of time that passes between key presses in minutes, and it displays the passing time in seconds as it is counting.

First, the clock makes sure you are ready to start the timer; it awaits you to press enter. Immediately afterward, the startTmr command is activated into the variable T. checkTmr(T tells how many seconds from the startTmr activation has gone by. When a key is pressed, a small calculation is performed to determined to find how many minutes have gone by.

This program is a basic example of how startTmr and checkTmr( can be used to count time. Unfortunately, this only works for the TI-84 series that have time compatibility.


Routine Summary

Counts down from a given time.

Inputs

M, S

Variables Used

T, M, S,A

Calculator Compatibility

TI-84/+/SE

Author

Timothy Foster/Updated by: Bio_Hazard1282

:Disp "Minutes?
:Input "",M
:Disp "Seconds?
:Input "",S
:60M+S→S
:AxesOff
:startTmr→T
:Repeat getKey or S=checkTmr(T
:Text(-1,0,0,S-checkTmr(T)+"     //1 space
:End
:ClrDraw
:ClrHome

This timer, instead of counting up, counts down from a given starting point. First, the program asks for minutes and seconds. Unfortunately, the checkTmr( command deals with seconds, so we must convert the minutes to seconds in order to make the program work better. According to the code, the timer will stop when either a key is pressed or the amount of time that passed is equal to the given amount of seconds.

We turn the axes off and reset the graph to zStandard mode, so the graph x and y axes won't be in the way. Then We add the 3 spaces after the Text( and checkTmr( commands. The T variable represents the amount of seconds that passes by after the startTmr command is executed. If we did not input the spaces, the seconds will look like 990 instead of 99.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.