Science Fair Projects Ideas - TI BASIC

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

TI-BASIC (calculators)

This article is about the calculator programming language. For the TI 99/4A home computer programming language, see TI BASIC (TI 99/4A) (note: no hyphen between "TI" and "BASIC" in that version).

TI-BASIC is the unofficial name of a BASIC-like language built into Texas Instruments graphing calculators (TI only refers to it as the calculators' "extensive programming capability"). This is the simplest way to program any TI calculator although assembly language may also be used (most often Z80 assembly). On the TI-89 and higher calculators (with a Motorola 68000 processor) you can also use C, through a compiler called TIGCC. Although TI-BASIC is considerably slower than C or assembler and consequently is not much good for programming fast applications and games, it is very useful for quickly writing programs to solve math problems.

Examples of TI-BASIC

(for the Z80-based models)

The following program, when run, will clear the screen and print the words "HELLO WORLD":

:ClrHome
:Disp "HELLO WORLD"

The next program will add the integers from 1 to 20 inclusive, and store the result to variable "A". It will then display the contents of A on a blank screen:

:Clrhome
:0->A
:For X,1,20
   :A+X->A
:End
:Disp A

This one will tell the user the numerical value of any button pressed except the 'on' key, and will continue to loop until the calculator is turned off.

:ClrHome
:Lbl 1
:getKey A
:While A=0
:getKey A
:End
:ClrHome
:Disp A
:Goto 1

A common feature of TI-BASIC game programming is programming the arrow buttons to move an object on the screen. This program will draw a dot on on the screen that will move according to which arrow buttons you press.

:ClrDraw
:-47 -> Xmin
:47 -> Xmax
:-31 -> Ymin
:31 -> Ymax
:0 -> X
:0 -> Y
:Lbl 1
:Pt-Off(X,Y)
:getKey -> C
:If C = 24
:X-1 -> X
:If C = 25
:Y+1 -> Y
:If C = 26
:X+1 -> X
:If C = 34
:Y-1 -> Y
:Pt-On(X,Y)
:Goto 1

However, this code is both large and slow. Attempts have been made to optimize TI-Basic. The program below does the same thing as the program above, yet is far smaller, and possibly somewhat faster.

:ClrDraw
:-47 -> Xmin
:47 -> Xmax
:-31 -> Ymin
:31 -> Ymax
:0 -> X
:0 -> Y
:Repeat 0
:Pt-Off(X,Y
:getKey -> C
:X+(C = 26)-(C = 24) -> X
:Y+(C = 25)-(C = 34) -> Y
:Pt-On(X,Y
:End

See also

External links

Last updated: 09-01-2005 00:57:32
03-10-2013 05:06:04
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice