Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: gibaoran on November 19, 2010, 01:12:47 am

Title: Ticks?
Post by: gibaoran on November 19, 2010, 01:12:47 am
How would I tell when the clock has gained a second best?

I am currently using:

Code: [Select]
:getTime->LB
:getTime->LA
:while LA(3)=LB(3)
:getTime->LB
://Second passed, do stuff

I am 100% certain there is a better way.
Title: Re: Ticks?
Post by: Xeda112358 on November 19, 2010, 01:48:29 am
Here is my best idea...

startTmr→A
Repeat checkTmr(A
End
Title: Re: Ticks?
Post by: gibaoran on November 19, 2010, 02:19:36 am
Ty :D. I never figured out what Repeat does, just looked it up though. Thanks again
Title: Re: Ticks?
Post by: Xeda112358 on November 19, 2010, 02:21:43 am
Not a problem! I have made many programs that use time, so I just happened to have an answer :D
Title: Re: Ticks?
Post by: gibaoran on November 19, 2010, 02:36:55 pm
So it almost works, except my timer starts  around this number 43438259, then counts up.
Maybe I am doing it wrong?
Code: [Select]
:ClrHome
:startTmr->A
:While 1
:Output(1,1,A
:Repeat checkTmr(A
:End
:A+1->A
:End
Title: Re: Ticks?
Post by: Xeda112358 on November 19, 2010, 02:38:43 pm
Oh so you want a timer, then? I thought you just wanted it to wait for a second. Do you want it to count down? If so, from where?
Title: Re: Ticks?
Post by: gibaoran on November 19, 2010, 02:40:04 pm
It is counting up. Can you reset the timer?
Title: Re: Ticks?
Post by: Xeda112358 on November 19, 2010, 02:43:11 pm
What are you trying to do, I am confused...?
Title: Re: Ticks?
Post by: AngelFish on November 19, 2010, 02:46:18 pm
If you want to reset it, just run StartTmr( again.
Title: Re: Ticks?
Post by: Xeda112358 on November 19, 2010, 02:48:32 pm
Or is this what you want:
Code: [Select]
:ClrHome
:startTmr→A
:Repeat 0
:Output(1,1,checkTmr(A
:End
Title: Re: Ticks?
Post by: gibaoran on November 22, 2010, 01:12:03 pm
Thats it. Thanks :D. (And for the confusion, I have one prg thats just a timer, and one that is eventually going to be an analog clock :P)