Actions
NewOpens the New dialog box where you enter a name and select a type for your ne…
OpenOpens a list of programs available in the current document.
Create CopyOpens the Create Copy dialog box where you can save the current program under…
RenameOpens the Rename dialog box where you can rename the current program.
CloseCloses the current program.
SettingsOpens the Settings dialog box where you can change the font size for both the…
Install as PythonChecks the Python syntax of the current TNS file and moves it to
modulethe PyLib folder.
Run
Run Ctrl+RChecks syntax, saves program, and executes in a Python Shell.
Check Syntax & Save Ctrl+BChecks syntax and saves program.
Go to ShellShifts focus to the Shell related to the current program or opens a new Shell…
Tools
Rerun Last Program Ctrl+RReruns the last program related to the current Shell.
Go to Python EditorOpens the Editor page related to the current Shell.
RunOpens a list of programs available in the current document. After selection,…
Clear HistoryClears the history in the current Shell but does not reinitialize the Shell.
Reinitialize ShellResets the state of all open Shell pages in the current problem. All defined…
dir()Displays list of functions in the specified module when used after the import…
From PROGRAM import *Opens a list of programs available in the current document. After selection,…
Install as Python ModuleEnabled only for modules in binary format. Moves the current TNS file to the…
Edit
IndentTAB* Indents text on the current line or selected lines. * If there are incom…
DedentShift+TAB** Dedents text on the current line or selected lines. ** If there a…
Comment/Uncomment Ctrl+TAdds/removes comment symbol to/from the beginning of the current line.
Insert Multi-line String(Editor only) Inserts multi-line string template.
Find Ctrl+F(Editor only) Opens Find dialog box and searches for the entered string in th…
Replace Ctrl+H(Editor only) Opens Replace dialog box and searches for the entered string in…
Go to Line Ctrl+G(Editor only) Opens Go to Line dialog box and jumps to the specified line in…
Beginning of Line Ctrl+8Moves cursor to the beginning of the current line.
End of Line Ctrl+2Moves cursor to the end of the current line.
Jump to Top Ctrl+7Moves cursor to the beginning of the first line in the program.
Jump to Bottom Built-ins Menu Functions Ctrl+1Moves cursor to the end of the last line in the program.
def function():Defines a function dependent on specified variables.
return ControlDefines the value produced by a function.
if..Conditional statement.
if..else..Conditional statement.
if..elif..else..Conditional statement.
for index in range(size):Iterates over a range.
for index in range(start,stop):Iterates over a range.
for index in range(start,stop,step):Iterates over a range.
for index in list:Iterates over list elements.
while..Executes statements in a code block until a condition evaluates to False.
elif:Conditional statement.
else: OpsConditional statement.
x=ySets variable value.
x==yPastes equal to (==) comparison operator.
x!=yPastes not equal to (!=) comparison operator.
x>yPastes greater than (>) comparison operator.
x>=yPastes greater than or equal to (>=) comparison operator.
x<yPastes less than (<) comparison operator.
x<=yPastes less than or equal to (<=) comparison operator.
andPastes and (and) logical operator.
orPastes or (or) logical operator.
notPastes not (not) logical operator.
TruePastes True Boolean value.
False ListsPastes False Boolean value.
[]Pastes brackets ([]).
list()Converts sequence into "list" type.
len()Returns number of elements of the list.
max()Returns maximum value in the list.
min()Returns minimum value in the list.
.append()The method appends an element to a list.
.remove()The method removes the first instance of an element from a list.
range(start,stop,step)Returns a set of numbers.
for index in range(start,stop,step)Used to iterate over a range.
.insert()The method adds an element at the specified position.
.split()The method returns a list with elements separated by specified delimiter.
sum()Returns sum of the elements of a list.
sorted()Returns a sorted list.
.sort() TypeThe method sorts a list in place.
int()Returns an integer part.
float()Returns a float value.
round(x,ndigits)Returns a floating point number rounded to the specified number of digits.
str()Returns a string.
complex()Returns a complex number.
type() I/OReturns the type of the object.
print()Displays argument as string.
input()Prompts user for input.
eval()Evaluates an expression represented as a string.
.format()The method formats the specified string.
Math
from math import *Imports all methods (functions) from the math module.
fabs()Returns absolute value of a real number.
sqrt()Returns square root of a real number.
exp()Returns e**x.
pow(x,y)Returns x raised to the power y.
log(x,base)Returns logbase(x). log(x) with no base returns the natural logarithm x.
fmod(x,y)Returns module value of x and y. Use when x and y are floats.
ceil()Returns the smallest integer greater than or equal to a real number.
floor()Returns the largest integer less than or equal to a real number.
trunc()Truncates a real number to an integer.
frexp() ConstReturns a pair (y,n) where x == y * 2**n.
eReturns value for the constant e.
pi TrigReturns value for the constant pi.
radians()Converts angle in degrees to radians.
degrees()Converts angle in radians to degrees.
sin()Returns sine of argument in radians.
cos()Returns cosine of argument in radians.
tan()Returns tangent of argument in radians.
asin()Returns arc sine of argument in radians.
acos()Returns arc cosine of argument in radians.
atan()Returns arc tangent of argument in radians.
atan2(y,x)Returns arc tangent of y/x in radians.
Random
from random import *Imports all methods from the random module.
random()Returns a floating point number from 0 to 1.0.
uniform(min,max)Returns a random number x (float) such that min <= x <= max.
randint(min,max)Returns a random integer between min and max.
choice(sequence)Returns a random element from a non-empty sequence.
randrange(start,stop,step)Returns a random number from start to stop by step.
seed()Initializes random number generator.
TI PlotLib
import ti_plotlib as plt SetupImports all methods (functions) from the ti_plotlib module in the "plt" names…
cls()Clears the plotting canvas.
grid(x-scale,y-scale,"style")Displays a grid using specified scale for x and y axes.
window(xmin,xmax,ymin,ymax)Defines the plotting window by mapping the the specified horizontal interval…
auto_window(x-list,y-list)Autoscales the plotting window to fit the data ranges within x-list and y-lis…
axes("mode")Displays axes on specified window in the plotting area.
labels("x-label","y-label",x,y)Displays "x-label" and "y-label" labels on the plot axes at row positions x a…
title("title")Displays "title" centered on top line of window.
show_plot()Displays the buffered drawing output. The use_buffer() and show_plot() functi…
use_buffer() DrawEnables an off-screen buffer to speed up drawing.
color(red,green,blue)Sets the color for all following graphics/plotting.
cls()Clears the plotting canvas.
show_plot()Executes the display of the plot as set up in the program.
scatter(x-list,y-list,"mark")Plots a sequence of ordered pair from (x-list,y-list) with the specified mark…
plot(x-list,y-list,"mark")Plots a line using ordered pairs from specified x-list and y-list.
plot(x,y,"mark")Plots a point using coordinates x and y with the specified mark style.
line(x1,y1,x2,y2,"mode")Plots a line segment from (x1,y1) to (x2,y2).
lin_reg(x-list,y-list,"display")Calculates and draws the linear regression model, ax+b, of x-list,y-list.
pen("size","style")Sets the appearance of all following lines until the next pen() is executed.
text_at(row,"text","align") PropertiesDisplays "text" in plotting area at specified "align".
xminSpecified variable for window arguments defined as plt.xmin.
xmaxSpecified variable for window arguments defined as plt.xmax.
yminSpecified variable for window arguments defined as plt.ymin.
ymaxSpecified variable for window arguments defined as plt.ymax.
mAfter plt.linreg() is executed in a program, the computed values of slope, m,…
bAfter plt.linreg() is executed in a program, the computed values of slope, a,…
TI Hub
from ti_hub import * Hub Built-in Devices > Color OutputImports all methods from the ti_hub module.
rgb(red,green,blue)Sets the color for the RGB LED.
blink(frequency,time)Sets the blinking frequency and duration for the selected color.
off() Hub Built-in Devices > Light OutputTurns the RGB LED off.
on()Turns the LED on.
off()Turns the LED off.
blink(frequency,time) Hub Built-in Devices > Sound OutputSets the blinking frequency and duration for the LED.
tone(frequency,time)Plays a tone of the specified frequency for the specified time.
note("note",time)Plays the specified note for the specified time. The note is specified using…
tone(frequency,time,tempo)Plays a tone of the specified frequency for the specified time and tempo. The…
note("note",time,tempo) Hub Built-in Devices > Brightness InputPlays the specified note for the specified time and tempo. The note is specif…
measurement()Reads the built-in BRIGHTNESS (light level) sensor and returns a reading. The…
range(min,max) Add Input Device This menu has a list of the sensors (input devices) supported by the ti_hub module. All the menu items will paste the name of the object and expect a variable and a port used with the sensor. Each sensor has a measurement() method that returns the value of the sensor.Sets the range for mapping the readings from the light level sensor. If both…
DHT (Digital Humidity & Temp)Returns a list consisting of the current temperature, humidity, type of senso…
RangerReturns the current distance measurement from the specified ultrasonic ranger…
Light LevelReturns the brightness level from the external light level (brightness) senso…
TemperatureReturns the temperature reading from the external temperature sensor. The def…
MoistureReturns the moisture sensor reading.
MagneticDetects the presence of a magnetic field. The threshold value to determine th…
VernierReads the value from the Vernier analog sensor specified in the command. The…
Analog InSupports the use of analog input generic devices.
Digital InReturns the current state of the digital pin connected to the DIGITAL object,…
Potentiometer () function. Thermistor Reads thermistor sensors. The default coefficients are designed to match the thermistor included in the Breadboard Pack of the TI-Innovator™ Hub, when used with a 10KΩ fixed resistor. A new set of calibration coefficients and reference resistance for the thermistor can be configured using the calibrate() function. Loudness Supports sound loudness sensors. Color Input Provides interfaces to an I2C-connected Color Input sensor. The bb_port pin is used in addition to the I2C port to control the LED on the color sensor. • color_number(): Returns a value from 1 to 9 that represents the color the sensor is detecting. The numbers represent the colors per the following mapping: 1: Red 2: Green 3: Blue 4: Cyan 5: Magenta 6: Yellow 7: Black 8: White 9: Gray • red(): Returns a value from 0 to 255 that represents the intensity of the RED color level being detected. • green(): Returns a value from 0 to 255 that represents the intensity of the GREEN color level being detected. • blue(): Returns a value from 0 to 255 that represents the intensity of the BLUE color level being detected. • gray(): Returns a value from 0 to 255 that represents the gray level being detected, where 0 is black and 255 is white. BB Port Provides support for using all 10 BB port pins as aSupports a potentiometer sensor. The range of the sensor can be changed by th…
Hub TimeProvides access to the internal millisecond timer.
TI-RGB Array Add Output Device This menu has a list of the output devices supported by the ti_hub module. All the menu items will paste the name of the object and expect a variable and a port used with the device.Provides functions for programming the TI-RGB Array. The initialization funct…
LEDFunctions for controlling externally connected LEDs.
RGBSupport for controlling external RGB LEDs.
TI-RGB ArrayProvides functions for programming the TI-RGB Array.
SpeakerFunctions for supporting an external speaker with the TI- Innovator™ Hub. The…
PowerFunctions for controlling external power with the TI-Innovator™ Hub. • set(va…
Continuous ServoFunctions for controlling continuous servo motors. • set_cw(speed,time): The…
Analog OutFunctions for the use of analog input generic devices.
Vibration MotorFunctions for controlling vibration motors. • set(val): Sets the vibration mo…
RelayControls interfaces for controlling relays. • on(): Sets the relay to the ON…
ServoFunctions for controlling servo motors. • set_position(pos): Sets the sweep s…
SquarewaveFunctions for generating a square wave. • set(frequency,duty,time): Sets the…
Digital OutInterfaces for controlling a digital output. • set(val): Sets the digital out…
BB Port CommandsProvides functions for programming the TI-RGB Array. See the details above.
sleep(seconds)Pauses the program for the specified number of seconds. Imported from the 'ti…
text_at(row,"text","align")Displays the specified "text" in the plotting area at specified "align". Part…
cls()Clears the Shell screen for plotting. Part of the ti_plotlib module.
while get_key() != "esc":Runs the commands in the "while" loop until the "esc" key is pressed.
get_key() Ports These are the input and output ports available on the TI-Innovator™ Hub. OUT 1 OUT 2 OUT 3 IN 1 IN 2 IN 3 BB 1 BB 2 BB 3 BB 4 BB 5 BB 6 BB 7 BB 8 BB 9 BB 10 I2CReturns a string representing the key pressed. The '1' key returns "1", 'esc'…
TI Rover
import ti_rover as rv DriveImports all methods (functions) from the ti_rover module in the "rv" namespac…
forward(distance)Moves Rover forward the specified distance in grid units.
backward(distance)Moves Rover backward the specified distance in grid units.
left(angle_degrees)Turns Rover left the specified angle in degrees.
right(angle_degrees)Turns Rover right the specified angle in degrees.
stop()Stops any current movement immediately.
stop_clear()Stops any current movement immediately and clears all pending commands.
resume()Resumes the processing of commands.
stay(time)Rover stays in place for the specified amount of time in seconds (optional).…
to_xy(x,y)Moves Rover to coordinate position (x,y) on virtual grid.
to_polar(r,theta_degrees)Moves Rover to polar coordinate position (r, theta) on virtual grid. The angl…
to_angle(angle,"unit") Drive > Drive with OptionsSpins Rover to the specified angle in the virtual grid. The angle is relative…
forward_time(time)Moves Rover forward for the specified time.
backward_time(time)Moves Rover backward for the specified time.
forward(distance,"unit")Moves Rover forward at the default speed for the specified distance. The dist…
backward(distance,"unit")Moves Rover backward at the default speed for the specified distance. The dis…
left(angle,"unit")Turns Rover left the specified angle. The angle can be in degrees, radians, o…
right(angle,"unit")Turns Rover right the specified angle. The angle can be in degrees, radians,…
forward_time(time,speed,"rate")Moves Rover forward for the specified time at the specified speed. The speed…
backward_time(time,speed,"rate")Moves Rover backward for the specified time at the specified speed. The speed…
forward(distance,"unit",speed,"rate")Moves Rover forward for the specified distance at the specified speed. The di…
backward(distance,"unit",speed,"rate") InputsMoves Rover backward for the specified distance at the specified speed. The d…
ranger_measurement()Reads the ultrasonic distance sensor on the front of the Rover, returning the…
color_measurement()Returns a value from 1 to 9, indicating the predominant color being "seen" by…
red_measurement()Returns a value between 0 and 255 that indicates the perceived red level bein…
green_measurement()Returns a value between 0 and 255 that indicates the perceived green level be…
blue_measurement()Returns a value between 0 and 255 that indicates the perceived blue level bei…
gray_measurement()Returns a value between 0 and 255 that indicates the perceived gray level bei…
encoders_gyro_measurement()Returns a list of values that contains the left and right wheel encoder count…
gyro_measurement()Returns a value that represents the current gyro reading, including drift, in…
ranger_time() OutputsReturns the time that the ultrasonic signal from the TI-Rover ranger takes to…
color_rgb(r,g,b)Sets the color of the Rover RGB LED to the specific red, green, blue values.
color_blink(frequency,time)Sets the blinking frequency and duration for the selected color.
color_off()Turns the Rover RGB LED off.
motor_left(speed,time)Sets the left motor power to the specified value for the specified duration.…
motor_right(speed,time)Sets the left motor power to the specified value for the specified duration.…
motors("ldir",left_val,"rdir",right_val,time) PathSets the left and right wheel to the specified speed levels, for an optional…
waypoint_xythdrn()Reads the x-coord, y-coord, time, heading, distance traveled, number of wheel…
waypoint_prevReads the x-coord, y-coord, time, heading, distance traveled, number of wheel…
waypoint_etaReturns the estimated time to drive to a waypoint.
path_done()Returns a value of 0 or 1 depending on whether the Rover is moving (0) or fin…
pathlist_x()Returns a list of X values from the beginning to and including the current Wa…
pathlist_y()Returns a list of Y values from the beginning to and including the current Wa…
pathlist_time()Returns a list of the time in seconds from the beginning to and including the…
pathlist_heading()Returns a list of the headings from the beginning to and including the curren…
pathlist_distance()Returns a list of the distances traveled from the beginning to and including…
pathlist_revs()Returns a list of the number of revolutions traveled from the beginning to an…
pathlist_cmdnum()Returns a list of command numbers for the path.
waypoint_x()Returns x coordinate of current waypoint.
waypoint_y()Returns y coordinate of current waypoint.
waypoint_time()Returns time spent traveling from previous to current waypoint.
waypoint_heading()Returns absolute heading of current waypoint.
waypoint_distance()Returns distance traveled between previous and current waypoint.
waypoint_revs() SettingsReturns number of revolutions needed to travel between previous and current w…
units/sOption for speed in grid units per second.
m/sOption for speed in meters per second.
revs/sOption for speed in wheel revolutions per second.
unitsOption for distance in grid units.
mOption for distance in meters.
revsOption for distance in wheel revolutions.
degreesOption for turning in degrees.
radiansOption for turning in radians.
gradiansOption for turning in gradians.
clockwiseOption for specifying wheel direction.
counter-clockwise Commands These commands are collection of functions from other modules as well as from the TI Rover module.Option for specifying wheel direction.
sleep(seconds)Pauses the program for the specified number of seconds. Imported from the tim…
text_at(row,"text","align")Displays "text" in plotting area at specified "align". Imported from the ti_p…
cls()Clears the Shell screen for plotting. Imported from the ti_plotlib module.
while get_key() != "esc":Runs the commands in the "while" loop until the "esc" key is pressed.
wait_until_done()Pauses the program until the Rover finishes the current command. This is a he…
while not path_done()Runs the commands in the "while" loop until the Rover is finished with all mo…
position(x,y)Sets the Rover position on the virtual grid to the specified x,y coordinate.
position(x,y,heading,"unit")Sets the Rover position on the virtual grid to the specified x,y coordinate,…
grid_origin()Sets RV as being at current grid origin point of (0,0).
grid_m_unit(scale_value)Sets the virtual grid spacing in meters per unit (m/unit) to the value specif…
path_clear()Clears any pre-existing path or waypoint information.
zero_gyro()Resets the Rover gyro to 0.0 angle and clears the left and right wheel encode…
Complex Math
from cmath import *Imports all methods from the cmath module.
complex(real,imag)Returns a complex number.
rect(modulus,argument)Converts polar coordinates to rectangular form of a complex number.
.realReturns real part of the complex number.
.imagReturns imaginary part of a complex number.
polar()Converts rectangular form to polar coordinates of a complex number.
phase()Returns phase of a complex number.
exp()Returns e**x.
cos()Returns cosine of a complex number.
sin()Returns sine of a complex number.
log()Returns natural logarithm of a complex number.
log10()Returns base 10 logarithm of a complex number.
sqrt()Returns square root of a complex number.
Time
from time import *Imports all methods from the time module.
sleep(seconds)Pauses the program for the specified number of seconds.
clock()Returns the current processor time as a floating number expressed in seconds.
localtime()Converts a time expressed in seconds since January 1, 2000 into a nine-tuple…
ticks_cpu()Returns a processor specific increasing millisecond counter with arbitrary re…
ticks_diff()Measures period between consecutive calls to ticks_cpu() or ticks_ms(). This…
TI System
from ti_system import *Imports all methods (functions) from the ti_system module.
recall_value("name")Recalls a predefined OS variable (value) named "name".
store_value("name",value)Stores a Python variable (value) to an OS variable named "name".
recall_list("name")Recalls a predefined OS list named "name".
store_list("name",list)Stores a Python list (list) to an OS list variable named "name".
eval_function("name",value)Evaluates a predefined OS function at the specified value.
get_platform()Returns "hh" for handheld and "dt" for desktop.
get_key()Returns a string representing the key pressed. The '1' key returns "1", 'esc'…
get_mouse()Returns mouse coordinates as a two element tuple, either the canvas pixel pos…
while get_key() != "esc":Run the commands in the "while" loop until the "esc" key is pressed.
clear_history()Clears the Shell history.
get_time_ms()Returns time in milliseconds with millisecond precision. This functionality c…
TI Draw
from ti_draw import * ShapeImports all methods from the ti_draw module.
draw_line()Draws a line starting from the specified x1,y1 coordinate to x2,y2.
draw_rect()Draws a rectangle starting at the specified x,y coordinate with the specified…
fill_rect()Draws a rectangle starting at the specified x,y coordinate with the specified…
draw_circle()Draws a circle starting at the specified x,y center coordinate with the speci…
fill_circle()Draws a circle starting at the specified x,y center coordinate with the speci…
draw_text()Draws a text string starting at the specified x,y coordinate.
draw_arc()Draws an arc starting at the specified x,y coordinate with the specified widt…
fill_arc()Draws an arc starting at the specified x,y coordinate with the specified widt…
draw_poly()Draws a polygon using the specified x-list,y-list values.
fill_poly()Draws a polygon using the specified x-list,y-list values filled with the spec…
plot_xy() Control clear() Clears the entire screen. Can be used with x,y,width,height clear_rect() Clears the rectangle at the specified x,y coordinate with the set_color() Sets the color of the shape(s) that follow in the program until set_pen() Sets the specified thickness and style of the border when drawing set_window() Sets the size of the window in which any shapes will be drawn. get_screen_dim() Returns the xmax and ymax of the screen dimensions. use_buffer() Enables an off-screen buffer to speed up drawing. paint_buffer() Displays the buffered drawing output. Notes • The default configuration has (0,0) in the top left corner of the screen. The positive x-axis points to the right and the positive y-axis points to the bottom This can be modified by using the set_window() function. • The functions in ti_draw module are only available on the handheld and in handheld view on desktop.Draws a shape using the specified x,y coordinate and specified number from 1-…
Variables
Vars: Current Program(Editor only) Displays a list of global functions and variables defined in th…
Vars: Last Run Program(Shell only) Displays a list of global functions and variables defined in the…
Vars: All(Shell only) Displays a list of global functions and variables from both the…