I am making a program in which I need a timer. I need this timer to run in the background will everything else runs in the foreground. Can someone give me some code to try to see if it works. If it does, I will add you as a co-author when I upload the program. The program is based on The Mad Minute in Math class.

Use the built in timer in OS 2.45, I think its in that OS...

Its not exactly a timer.. But its a clock. So you can make a program that when ran once, will store a time.. and then ran a second time will store the second time and subtract. I think you could do that in ti-Basic even.

Its not exactly a timer.. But its a clock. So you can make a program that when ran once, will store a time.. and then ran a second time will store the second time and subtract. I think you could do that in ti-Basic even.

THat is what I am trying to do. I am making the program for TI-83+, so the startTmr isn't in the database.

- APotato
- Power User (Posts: 354)

- 21 Oct 2014 09:53:43 pm
- Last edited by APotato on 21 Oct 2014 09:56:01 pm; edited 1 time in total

Alrighty then, you could use a value which you add to every time but it would be inaccurate. I guess zeldakings method would be the best

- uiouio111
- Newbie (Posts: 24)

- 21 Oct 2014 09:57:13 pm
- Last edited by uiouio111 on 22 Oct 2014 05:06:04 pm; edited 1 time in total

Edit: I was wrong

Hmm I've seen that in zeldakings minesweeper program, the timer simply displays one value larger than the previous one when it is run

I think, every time it is one second, the original program runs another program that adds one to the current value and displays it

And how would the codefor that look? Also, since my program is based on The Mad Minute, would doing something like this impede from the need to complete as many as you can as fast as you can?

Given you don't have the precise time bases available on the 84+ hardware (crystal timers, RTC), there's not an easy way to do it. The clocks on the 83+ are all derived from a (pretty variable) RC oscillator, so anything you do will need calibration.

The only remotely reliable way to measure time on the 83+ is via timer interrupts, which are (sadly) not very accurate, and I don't know what effect a running TI-BASIC program might have on interrupt processing.

In any case, I'd go about implementing this with a helper TSR assembly program (probably with another helper to remove the TSR) that counts timer interrupts and stores a specific value to some BASIC-accessible variable which can be polled regularly when the limit is reached. Given the previously-mentioned inaccuracy of the RC oscillator you'd want to have a way for the user to calibrate to their timers ("wait for a minute then press any key" or something fairly easy).

The only remotely reliable way to measure time on the 83+ is via timer interrupts, which are (sadly) not very accurate, and I don't know what effect a running TI-BASIC program might have on interrupt processing.

In any case, I'd go about implementing this with a helper TSR assembly program (probably with another helper to remove the TSR) that counts timer interrupts and stores a specific value to some BASIC-accessible variable which can be polled regularly when the limit is reached. Given the previously-mentioned inaccuracy of the RC oscillator you'd want to have a way for the user to calibrate to their timers ("wait for a minute then press any key" or something fairly easy).

I am fairly new at programming calculators. This is the first program I have made all of the code for thus far. Here is the code that I have.

Right now, I have it where you play to a certain point value, then it stops. Do you have any suggestions. If not, then I will make one more edit then upload the program.

**Code:**```
ClrHome
```

1->dim(L1)

0->L1(1)

Disp "Try To Finish In","Under One Minute"

Pause

Menu(" Which One? ","Addition",A,"Subtraction",S,"Multiplication",M,"Division",D,"Random",F)

Lbl A

ClrHome

Input "How Many Digits?",B

B-1->B

If B>=5

Then

Disp "No More Then","Five Digits."

Pause

Goto A

End

Goto A2

Lbl A2

If L1(1)=20

Goto 1

randInt(10^B,9*10^B)->C

randInt(10^B,9*10^B)->D

ClrHome

Output(8,1,"Points: "):Output(8,9,L1(1))

Output(1,1,C):Output(1,2+B,"+"):Output(1,3+B,D)

For(E,1,2B+3)

Output(2,E,"-")

End

Disp "",""

Input "",E

If E=(C+D)

L1(1)+1->L1(1)

Goto A2

Lbl S

ClrHome

Input "How Many Digits?",B

B-1->B

If B>=5

Then

Disp "No More Then","Five Digits."

Pause

Goto S

End

Goto S2

Lbl S2

If L1(1)=20

Goto 1

randInt(10^B,9*10^B)->C

randInt(10^B,9*10^B)->D

ClrHome

Output(8,1,"Points: "):Output(8,9,L1(1))

Output(1,1,C):Output(1,2+B,"-"):Output(1,3+B,D)

For(E,1,2B+3)

Output(2,E,"-")

End

Disp "",""

Input "",E

If E=(C-D)

L1(1)+1->L1(1)

Goto S2

Lbl M

ClrHome

Input "How Many Digits?",B

B-1->B

If B>=5

Then

Disp "No More Then","Five Digits."

Pause

Goto M

End

Goto M2

Lbl M2

If L1(1)=20

Goto 1

randInt(10^B,9*10^B)->C

randInt(10^B,9*10^B)->D

ClrHome

Output(8,1,"Points: "):Output(8,9,L1(1))

Output(1,1,C):Output(1,2+B,"*"):Output(1,3+B,D)

For(E,1,2B+3)

Output(2,E,"-")

End

Disp "",""

Input "",E

If E=(CD)

L1(1)+1->L1(1)

Goto M2

Lbl D

ClrHome

Disp "Answer To Three","Digits Please"

Pause

Goto D3

Lbl D3

ClrHome

Input "How Many Digits?",B

B-1->B

If B>=5

Then

Disp "No More Then","Five Digits."

Pause

Goto D3

End

Goto D2

Lbl D2

If L1(1)=20

Goto 1

randInt(10^B,9*10^B)->C

randInt(10^B,9*10^B)->D

ClrHome

Output(8,1,"Points: "):Output(8,9,L1(1))

Output(1,1,C):Output(1,3+B,D):Output(1,2+B,"/")

For(E,1,2B+3)

Output(2,E,"-")

End

Disp "",""

Input "",E

If round(E,3)=round((C/D),3)

L1(1)+1->L1(1)

Goto D2

Lbl F

ClrHome

Disp "Answer To Three","Digits For","Division Please"

Pause

Goto F3

Lbl F3

ClrHome

Input "How Many Digits?",B

B-1->B

If B>=5

Then

Disp "No More Then","Five Digits."

Pause

Goto F3

End

Goto F2

Lbl F2

If L1(1)=20

Goto 1

randInt(10^B,9*10^B)->C

randInt(10^B,9*10^B)->D

randInt(1,4)->F

ClrHome

Output(8,1,"Points: "):Output(8,9,L1(1))

Output(1,1,C):Output(1,3+B,D)

If F=1:Output(1,2+B,"+")

If F=2:Output(1,2+B,"-")

If F=3:Output(1,2+B,"*")

If F=4:Output(1,2+B,"/")

For(E,1,2B+3)

Output(2,E,"-")

End

Disp "",""

Input "",E

If F=1

Then

If E=(C+D)

L1(1)+1->L1(1)

End

If F=2

Then

If E=(C-D)

L1(1)+1->L1(1)

End

If F=3

Then

If E=(CD)

L1(1)+1->L1(1)

End

If F=4

Then

If round(E,3)=round(C/D,3)

L1(1)+1->L1(1)

End

Goto F2

Lbl 1

ClrHome

Disp "Congratulations!","You Got A Total","Of 20 Points!","Did You Meet","Your Goal?"

Pause

ClrHome

Output(1,1,"")

Right now, I have it where you play to a certain point value, then it stops. Do you have any suggestions. If not, then I will make one more edit then upload the program.

Register to Join the Conversation

Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page

» Go to Registration page

Page

**1**of**1**
» All times are UTC - 5 Hours

You

You

You

You

You

**cannot**post new topics in this forumYou

**cannot**reply to topics in this forumYou

**cannot**edit your posts in this forumYou

**cannot**delete your posts in this forumYou

**cannot**vote in polls in this forumAdvertisement