I've been messing around with BASIC programming on my calculator and have run into a bunch of questions that I can't find the answer to. Thanks for the help!

How do I pause a program for an amount of time (I know you can pause until you press enter, but I want to pause for say a half second)?

Are there any programs similar to Ti-Connect? (Ti-Connect is always having a bunch of errors and the only apparent way to fix them is to restart with no internet, but every time I restart, my internet auto connects)

Making programs with a lot of labels/gotos gets really confusing... I've also found by looking around that they are discouraged. What is an alternative to them?

I'm making a program that calculates and displays the volume/surface area of spheres and other round objects. I want the final answer to be in terms of Pi so it is more accurate (something like 38(Pi) instead of 119.3805208.....). How do I make it do this so that the number part of the answer is on the same line as the Pi symbol? I'm using, Disp A, "Pi symbol" where A is the number part of the answer. But, when it displays this, it is on two different lines; it says the number all the way to the right and then the Pi symbol on a new line to the left.

Is there a command to change the screen brightness? Like when I press 2nd and the up or down arrow keys, it changes the brightness. I need a command that you can use in a program.

Any way to tell how much battery is left. It's really annoying when it runs out in math class or something.
Hi Fluke_Man, glad that you're looking into programming the TI-84, its great fun.

Some of your questions:

There are several ways to create a pause, maybe one of the easier ways is to use a For loop:

For(A,0,50,1):End

Just adjust the 50 for the delay, this may not be constant all the time however. Can i ask what the delay is for? Usually you wont look at slowing down your program until your finished.

Lbl/Goto has its pros/cons, as do other methods of program control. It really comes down to the way in which your program needs to be structured. You can look at using Repeat, If/Then, Menus and such as well. There are some good BASIC programming resources around, have you managed to check any out?

http://tibasicdev.wikidot.com
And of course Kerm's fab programming books found here: http://www.cemetech.net/tools/index.php

Also the help section for historical content as well.

There are alternatives to TI-Connect, namely TiLP which can be found here: http://lpg.ticalc.org/prj_tilp/
Fluke_Man wrote:

How do I pause a program for an amount of time (I know you can pause until you press enter, but I want to pause for say a half second)?

The most reliable way is to do something like For(A,1,somelargenumber):1+1:End . CPU speeds are accurate to +/-20 %.

Fluke_Man wrote:

Are there any programs similar to Ti-Connect? (Ti-Connect is always having a bunch of errors and the only apparent way to fix them is to restart with no internet, but every time I restart, my internet auto connects)

You can try TiLP. When are you getting errors? What OS are you using? What calculator are you trying to connect to? What cable are you using? What file(s) do you wish to send?

TI Connect's error messages are notoriously unhelpful. For example, I had it tell me that my computer was out of hard drive space when I tried to transfer a program whose name contained a space. Yes, it will refuse to receive variables with an invalid name, and give a totally unrelated error message.

Fluke_Man wrote:

Making programs with a lot of labels/gotos gets really confusing... I've also found by looking around that they are discouraged. What is an alternative to them?

For(, While, and Repeat loops are the normal for loops.

Fluke_Man wrote:

I'm making a program that calculates and displays the volume/surface area of spheres and other round objects. I want the final answer to be in terms of Pi so it is more accurate (something like 38(Pi) instead of 119.3805208.....). How do I make it do this so that the number part of the answer is on the same line as the Pi symbol? I'm using, Disp A, "Pi symbol" where A is the number part of the answer. But, when it displays this, it is on two different lines; it says the number all the way to the right and then the Pi symbol on a new line to the left.

You can't do it using Disp. You can use Output(row,column,variable instead. You'll want to clear the screen first with ClrHome.

Fluke_Man wrote:

Is there a command to change the screen brightness? Like when I press 2nd and the up or down arrow keys, it changes the brightness. I need a command that you can use in a program.

Any way to tell how much battery is left. It's really annoying when it runs out in math class or something.


You cannot do either in a BASIC program alone. Assembly programs can do both easily enough. It matters to some degree on the model.
Fluke_Man wrote:
I've been messing around with BASIC programming on my calculator and have run into a bunch of questions that I can't find the answer to. Thanks for the help!
You've come to the right place! Note that I've linked out quite a bit to [url=tibasicdev.wikidot.com/]TI Basic Developer[/url], which is a great resource for commands.

Quote:
How do I pause a program for an amount of time (I know you can pause until you press enter, but I want to pause for say a half second)?
If you're on the 83+-series, the standard way is to use the rand(number) command. It's the most consistent way of pausing for a duration. The bigger the number, the longer the wait.
For the 84+-series, you can use the startTmr and checkTmr commands. Note the caveat, though: "While this method eliminates human error from counting, it's prone to its own faults. A major one is that startTmr and checkTmr( always return whole numbers, but time is continuous. Depending on how close the start and end of the loop were to a clock tick, the number of seconds may be off by up to one second in either direction." So if you need precision and consistency in your timer, use rand.

I find the best way to pause is to use something like:
Repeat getKey:End
This way the user can press any key to advance, instead of just enter, and it pauses for however long the user needs it to.

Quote:
Are there any programs similar to Ti-Connect? (Ti-Connect is always having a bunch of errors and the only apparent way to fix them is to restart with no internet, but every time I restart, my internet auto connects)
TiLP is the goto replacement.

Quote:
Making programs with a lot of labels/gotos gets really confusing... I've also found by looking around that they are discouraged. What is an alternative to them?
Generally wise use of Whiles, Repeats, Ifs, and subprograms can help. If you have any code specifically you want help with, feel free to post it and we can help clean it up for you.

Quote:
I'm making a program that calculates and displays the volume/surface area of spheres and other round objects. I want the final answer to be in terms of Pi so it is more accurate (something like 38(Pi) instead of 119.3805208.....). How do I make it do this so that the number part of the answer is on the same line as the Pi symbol? I'm using, Disp A, "Pi symbol" where A is the number part of the answer. But, when it displays this, it is on two different lines; it says the number all the way to the right and then the Pi symbol on a new line to the left.
Use the Output( command to position text on the home screen, or the Text( command for the graph screen.

Quote:
Is there a command to change the screen brightness? Like when I press 2nd and the up or down arrow keys, it changes the brightness. I need a command that you can use in a program.
Any way to tell how much battery is left. It's really annoying when it runs out in math class or something.

Back when I did lots of BASIC programming, I used a program called BASIC Tools which provides you with both of these things. There may be better things out there now, but at least those'll work.

Hope this helps!
Use the Doors CS BASIC Libs to change the contrast. You can also, using DCS, convert a number to string and do
Code:
Disp det(1,VAR)+"pi"
to print pi and number on the same line.
I know it's not true BASIC, but it's basically BASIC.
Fluke_Man wrote:
Any way to tell how much battery is left. It's really annoying when it runs out in math class or something.

The Doors CS shell has a battery indicator, but I don't trust it. When your batteries are low, the TI-OS tells you that your batteries are about to run out of charge. (But I use rechargeable batteries.)
DoorsCS7 bases its energy indicator off of how dark the screen's contrast is. 5 gives a full battery, 6 gives less, and so on. I believe that the battery indicator doesn't indicate "Battery Level" as much as it does "Battery Usage".
I can usually help with any basic programming needs so if you have questions then I have answers.
  
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