Hub Programming on TI-Nspire™ CX Technology
Note:
These instructions apply to TI-Nspire™ CX technology. For similar instructions for
TI CE graphing calculator, refer to Hub Programming on TI CE Graphing Calculator
(page 7).
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
and
GetStr
- Retrieve information requested from the Hub.
•
eval()
- Supplies the result of an expression as a character string. Valid only within
Send
,
Get
, and
GetStr
commands.
•
Wait
- Pauses program execution for a specified number of seconds.
Code Examples: TI-Nspire™ CX Technology
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-Nspire™ CX program uses the
Send
and
Wait
commands to blink the
on-board red LED in the Hub. The commands are contained in a "For...EndFor" loop that
repeats the ON/OFF blink cycle for 10 iterations.
15