Looking for some reference material.

My daughter has a project involving a Norland calculator robot with a TI83.

She has sucessfully programed all the things needed to move the robot around...but we are stumped on creating a countdown timer/display...I don't think she was given all the reference material.

She has to countdown ten seconds, displaying "T-10" at start and end with "Lift Off" displayed.

This may be easier than it seems but we only have a workbook that doesn't have a reference list or explanations for the functions.

Can anyone point us to what we need? Any help appreciated.
Unless you're running on a calculator with a real-time clock (84+/SE), there's no way to track wall time with much accuracy. A common way to fake it is with a busy-loop:
Code:
:For(X,0,1000
:End

A little googling indicates that 1000 iterations will delay for about 1 second on a standard 83+, but I haven't checked that myself. You can adjust the limit value (1000 in my example) up or down to delay for a longer or shorter period of time, respectively.
This should keep steady with the timer for more than a minute (if it were allowed to go as far):

Code:
:ClrHome
:For(A,10,1,-1
:Output(1,1,"T-«two spaces»
:Output(1,3,A
:For(B,0,8
:End
:Send(A
:End
:Output(1,1,"LIFT OFF

Note to ambitious copy-pasters: Merely ripping out the outputs and/or displacing them with your own code will not work, because the third argument in the inner For( loop is "keyed" to these particular commands. This is also prepared for the processor speed of the standard TI-83+ (non-SE); it will likely run faster than desired on higher models. Be sure to test any special changes to it thoroughly rather than hope that it remains accurate.
Thanks, that is working, turns out we only have to count down...doesn't need to time.

However, it counts T-10, T-90, T-80 etc.

Haven't tried it yet, but I think I we reduce one of the "two spaces" it will go to single digits...but then it won't show T-10 to start.

Also, we are trying to add this to the end of a progarm that drives robot wheel motors. Will the clear home mess this up?
Write the code as it is given. You're jumping to faulty conclusions about its behavior based on zero empirical data, which is a no-no.

~Foo Fighter~ wrote:
However, it counts T-10, T-90, T-80 etc.

That would only be if you removed the two spaces.

~Foo Fighter~ wrote:
Haven't tried it yet, but I think I we reduce one of the "two spaces" it will go to single digits...

The spaces are positioned to overwrite the the previous number. It needs to be two spaces in order to remove the "0" from the "10" in the second pass.

~Foo Fighter~ wrote:
but then it won't show T-10 to start.

It will definitely show the entire "T-10", because the "10" is written by the next line when A=10.

~Foo Fighter~ wrote:
Also, we are trying to add this to the end of a progarm that drives robot wheel motors. Will the clear home mess this up?

ClrHome wipes the screen clear of any text that was on it previously. That's its only function.

If you want a minimalistic routine that doesn't need to measure time very accurately, then go with this:

Code:
:Disp "T-
:For(X,10,1,-1
:Disp X
:rand(27
:End
:Disp "LIFT OFF
THANKS! Great stuff.

My daughter did not do "two spaces", she thought that meant to add two empty lines...she'll have to fix this or try the simple program and add this to the end of her drive program to finish her project (due tomorrow).

Thanks for all the help, great learning experience for a 12yr old (and a 48yr old).
Very cool! Any plans to record a video of the thing driving around?
~Foo Fighter~ wrote:
My daughter did not do "two spaces", she thought that meant to add two empty lines...she'll have to fix this or try the simple program and add this to the end of her drive program to finish her project (due tomorrow).

Thanks for all the help, great learning experience for a 12yr old (and a 48yr old).

Ahh, yes. I was talking about horizontal spaces ([ALPHA] [0]). Best of luck.
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement