Hub Programming on TI CE Graphing Calculator

Note: These instructions apply to TI CE graphing calculator. For similar instructions for TI‑Nspire™ CX technology, refer to Hub Programming on TI‑Nspire™ CX Technology (here).

The TI‑Innovator™ Hub responds to TI Basic programming commands such as Send and Get.

Send - Sends command strings to the Hub to control devices or request information.
Get - Retrieves information requested from the Hub.
eval - Supplies the result of an expression as a character string. Especially useful within the Hub command string in Send commands.
Wait - Pauses program execution for a specified number of seconds.

Code Examples: TI CE Graphing Calculator

Desired Action

Program Code

Turn on the on-board Red LED ("LIGHT").

Send("SET LIGHT ON")

Play a 440Hz tone on the on-board speaker ("SOUND") for 2 seconds.

Send("SET SOUND 440 TIME 2")

Turn on blue element of on-board RGB LED ("COLOR") at 100% brightness.

Send("SET COLOR.BLUE 255")

Read and display the current value of the on-board light sensor ("BRIGHTNESS"). Range is 0% to 100%.

Send("READ BRIGHTNESS")
Get(A):Disp A

 

Sample Program to Blink an On-Board LED

The following TI CE graphing calculator program uses the Send and Wait commands to blink the on-board red LED in the Hub. The commands are contained in a "For...End" loop that repeats the ON/OFF blink cycle for 10 iterations.

PRGM: BLINK
For(N,1,10)
Send("SET LIGHT ON")
Wait 1
Send("SET LIGHT OFF")
Wait 1
End

How to Create and Execute a Program

Note: These are abbreviated instructions. For detailed instructions on creating and executing programs, refer to TI-Basic Programming for the TI CE Graphing Calculator.

Before You Begin

Refer to System Requirements (here), and update your calculator's OS (Operating System) and Hub App, as needed. You can update from TI Connect™ CE software or from another updated calculator.

Note: The TI-Innovator™ Hub App is available for download from the TI website at education.ti.com/latest.

To Create a New Program on TI CE Graphing Calculator:

1. On the Home Screen, press ¼, select New, and press Í.
2. Type a name for your program, such as "SOUNDTST," and then press Í.

The Program Editor opens, displaying a template for your program code.

3. Enter the lines of code that make up your program.
- You must use the Hub Menu to enter TI‑Basic commands, such as Send and Get. (Press ¼ and select Hub.)
- You can enter Hub command strinSetgs and parameters such as "SET LIGHT ON" by using the menu or by typing. If you type the strings, make sure to use the correct case.
- At the end of each line, press Í. Each new line is automatically preceded by a colon (:).
- Use the arrow keys to move through a program. Press { to delete, or press y 6 to insert.

To Close the Program Editor

Press y 5 to return to the Home Screen.

The program remains available through the ¼ key.

To Run the Program:

1. Ensure that the TI‑Innovator™ Hub is connected to your calculator.
2. Ensure that any needed I/O Modules or Breadboard components are connected to the Hub.
3. From the Home Screen, press ¼, select your program name from the displayed list, and press Í.

The program name is pasted to the Home Screen.

4. Press Í again to run the program.

To Edit an Existing Program:

1. On the Home Screen, press ¼, select Edit.
2. Select the program name from the displayed list, and press Í.

The program opens in the Program Editor.

Using the Hub Menu to Build Commands

The Hub menu is available on the TI CE graphing calculator anytime you are creating or editing a program. It can save you time building commands and help you with correct command spelling and syntax.

Note: To build a command from the Hub menu, you need to know:

The unique name of the component that you are addressing, such as "SOUND" for the on-board speaker.
The command parameters that apply to the component, such as sound frequency and duration. Some parameters are optional, and you might need to know the value range of a parameter.

Example of Using the Hub Menu:

This TI CE graphing calculator example builds the command Send ("SET SOUND 440 TIME 2") to sound a 440Hz tone for 2 seconds on the on-board speaker.

1. Open (or create) the program that you will use to communicate with the Hub.
2. Position the cursor where you want to place the command.
3. Press ¼ and select Hub.

The Hub menu appears.

4. Select Send "SET and press Í, and then select SOUND and press Í.

5. Type 440 as the sound frequency.

6. On the Hub menu, select Settings > TIME.

7. Type 2 as the TIME value.

8. To complete the command, type closing quotes (press ƒ Ã), and then press ¤.

9. To return to the Home Screen and test the command, press y 5 and then follow the previous instructions for running a program.

Tips for Coding with TI CE Graphing Calculator

Make sure your code is free of unnecessary spaces that can cause syntax errors. This includes repeated spaces within the line and one or more spaces at the end of a line.
Code from an external source might show "curly" quotation marks (...) in places that require straight quotes ("..."). To type straight quotes, press ƒ and then Ã.
To clear the current line of code, press .
To type relational operators such as =, <, and , press y :.
To type a space, press ƒ and then Ê.
If your program becomes unresponsive while running, press the É key.
Note: If a command syntax does not include an opening left parenthesis, such as "Wait ", using a pair of parentheses in an argument may be interpreted as the full argument and give an unexpected syntax error. When entering long expressions with parentheses, enclose the entire expression with paired parentheses to avoid syntax errors of this nature.

Valid: Wait ((X+4)*5)
Valid: Wait X+4*5
Syntax Error: Wait (X+4)*5