TI-BASIC Tutorial

This Tutorial's goal is to introduce a person with no programming experience to TI-BASIC for the TI-83 Family.

Basics
Before one can learn how to program, one must understand the concept of variables. A variable is a data piece. On the TI they are used to store numbers, and have names ranging from A to Theta. To use a variable, press the number, then press the STO button and the variable name. To access a variable, press ALPHA and then the button with the green letter name next to it. It should also be noted that variables can be used to store information to other variables. Next, one needs to know how to make a program. Press PRGM, then go to new, then press new program. A program must start with an Alpha character. To access the programming interface, press PRGM again. Now, one can begin to write their first program.

First Program
First, create a program and title it HELLO. For this exercise we will be making a program that will display Hello. Now, press PRGM to access the programming interface, press right button, and scroll down to ClrHome. Now press enter. This command clears the home screen. Now, find Disp. Enter this and type after it "HELLO". Make sure to use quotes. Without quotes, the calculator will print the value H*E*L*L*O. With quotes, the Disp command will print HELLO on the next line. Now, exit to the home screen and press PRGM, select HELLO, and press enter. It should be noted that if you ever wish to end a program, simply press on to cut it. If done correctly your calculator should clear the screen and display HELLO. If not, then check this code.

:ClrHome
:Disp "HELLO"


Goto and Label
Now we will modify the program to display HELLO indefinety until we break it. To do this, simply place a Lbl and any two letters between ClrHome and Disp. Then after Disp put a Goto with the same two letters as the Lbl. This causes the program to go to the label
whenever it reaches the goto command. Eg. it would go to label XY when it hits Goto XY but not if it hit Goto XZ. The correct code for this exersize is.

:ClrHome
:Lbl A
:Disp "HELLO"
:Goto A

Please note that any one or two letter or Theta combo can be used for the Lbl and Goto; just make sure they match.

Input
Now we are going to make a useful program that will solve this equation; 3X+4Y+6Z=?. To do this we must learn the command Input. The syntax is Input "Optional text", variable. The calculator will wait for you to enter a value for the variable, then execute the code that follows it. Another useful command is Pause. This will pause the program until enter is hit. Now, try to make a program using the commands given to clear the screen, solve this equation, and repeat the process. The code is:

:Lbl A
:ClrHome
:Input "X".X
:Input "Y",Y
:Input "Z",Z
:3X+4Y+6Z STO A
:Disp A
:Pause
:Goto A

Remember, that the variables can be changed. You can even say Input "X",B. Just make sure that you use B instead of X in the equation(3B+4Y+6Z STO A).
 
< Prev   Next >