E-mail Address
Password

Register
arasian > support > education > tutorial

Ti-83 Basic
The Basics
     1.1: Getting Started
     1.2: The "Disp" Command
     1.3: The "Input" Command
     1.4: Strings
     1.5: If-Then Statements
     1.6: "For" Loops
     1.7: "While" Loops
     1.8: The "Getkey" Command
Creating Menus
     2.1: Lbl and Goto Commands
     2.2: The "Menu" Command
Graphics
     3.1: Setting up for Drawing
     3.2: Graphing
     3.3: Graph-Coordinates Drawing
     3.4: Screen-Coordinates Drawing
     3.5: Pictures
     3.6: "Input" Revisited
     3.6: Advanced Menus
     3.8: Dynamic Menus
     3.9: Dialog Boxes
Miscellaneous
     4.1: Memory Management
     4.2: Creating Lists and Saved Games
     4.3: Using with MirageOS
     4.4: Tips and Hints
The "Getkey" Command

The getKey command is a command that gets a keypress and stores the information to a variable. This is useful if you have interactive graphics, or many other things. The command looks like this:
:getKey->D

First, you need to know how the keyboard is mapped out. The tens go from the top row down, starting with 10 and ending with 100. Ones go across to the right, and start with 1 (not 0!), and end with 5. It may be a little confusing, but here are some examples:
Y= (11).....Graph (15).....Enter (105).....2nd (21).....Alpha (31).....Apps (42)
So, find the coordinates of the Math key. You should have gotten 41. Next, try to find the coordinates of the 1 key. It should be 92. There are five exceptions to this:
The On key (You can't use this during a program or else it breaks it. This has no mapping).....Left Arrow (24).....Up Arrow (25).....Right Arrow (26).....Down Arrow (34)
However, getKey doesn't wait for you to press a key. If you don't have a key pressed, it skips over everything. So, how do you have it wait until you press a key? (Note, sometimes you don't want to do this, so just leave out the following lines of code).
:0->D
:While D=0
:getKey->D
:End
And here you go on to...
:If D=24
:BlahBlahBlah...

The
Key
Program
This next program that you should write should clear the homescreen, wait for the user to press a key, and then tell what they key is. You don't have to map out all the keys on the keyboard, just popular ones like 2nd and Arrow Keys. A copy of the code is found below.

Here's the code to the Key program.
:ClrHome
:0->D
:While D=0
:getKey->D
:End
:If D=21
:Disp "2nd"
:If D=31
:Disp "Alpha"
:If D=24
:Disp "Left Arrow"
And so on

This will be the end of section 1. Try programming a bit to get a feel for the commands. Remember, the best way to learn this stuff is to experiment!
Creative Commons License
The text in this tutorial is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Privacy Policy | Contact Us
(c) 1999-2010 Arasian. All rights reserved.