Commands

These commands are collection of functions from from ti_system import* modules as well as from the TI Rover module.

sleep(seconds)

Command:

sleep(seconds)

Command
Syntax:

sleep(seconds)

Module:

ti_system

Describe:

Sleep for a given number of seconds. Seconds argument is a float.

Python
Code
Sample:

from time import *

a=monotonic()

sleep(15)

b=monotonic()

print(b-a)

 

Run the program TIME

>>>15.0

Result:

Sleep for a given number of seconds. Seconds argument is a float.

Error:

 

Type or
Addressable
Component:

from ti_system import*

See Also:sleep

 

disp_at(row,col,"text")

Command:

disp_at(row,col,"text")

Command
Syntax:

disp_at(row,col,"text")

Module:

ti_system

Describe:

Display text starting at a row and column position on the plotting area.

REPL with cursor >>>| will appear after text if at end of program. Use disp_cursor() to control cursor display.

Python
Code
Sample:

from ti_system import *

disp_clr() #clears Shell screen

disp_at(5,6,"hello")

disp_cursor(0)

disp_wait()

Result:

Display text starting at a row and column position on the plotting area.

Error:

 

Type or
Addressable
Component:

from ti_system import*

See Also:disp_at(r,c,t)

 

disp_clr()

Command:

disp_clr()                  clear text screen

Command
Syntax:

disp_clr()                  clear text screen

Module:

ti_system

Describe:

Clear the screen in the Shell environment. Row 0-11, integer may be used as an optional argument to clear a display row of the Shell environment.

Python
Code
Sample:

from ti_system import *

disp_clr() #clears Shell screen

disp_at(5,"hello","left")

disp_cursor(0)

disp_wait()

Result:

Clear the screen in the Shell environment. Row 0-11, integer may be used as an optional argument to clear a display row of the Shell environment.

Error:

 

Type or
Addressable
Component:

from ti_system import*

See Also:disp_clr()

 

disp_wait()

Command:

disp_wait()                  [clear]

Command
Syntax:

disp_wait()                  [clear]

Module:

ti_system

Describe:

Stop the execution of program at this point and display screen content until [clear] is pressed and the screen is cleared.

Python
Code
Sample:

from ti_system import *

disp_clr() #clears Shell screen

disp_at(5,"hello","left")

disp_cursor(0)

disp_wait()

Result:

Stop the execution of program at this point and display screen content until [clear] is pressed and the screen is cleared.

Error:

 

Type or
Addressable
Component:

from ti_system import*

See Also:disp_wait()

 

disp_cursor()

Command:

disp_cursor()                  0=off 1=on

Command
Syntax:

disp_cursor()                  0=off 1=on

Module:

ti_system

Describe:

Control the display of the cursor in the Shell when a program is running.

Python
Code
Sample:

from ti_system import *

disp_clr() #clears Shell screen

disp_at(5,"hello","left")

disp_cursor(0)

disp_wait()

Result:

Control the display of the cursor in the Shell when a program is running.

Error:

 

Type or
Addressable
Component:

from ti_system import*

See Also:disp_cursor()

 

while not escape():                  clear

Command:

while not escape():                  clear

Command
Syntax:

while not escape():                  clear

Module:

ti_system

Describe:

In a while loop running in a program where the program offers to end the loop but keep the script running.

 

Run the commands in the "while" loop until the "esc" key is pressed..

Python
Code
Sample:

 

Result:

 

Error:

 

Type or
Addressable
Component:

from ti_system import*

 

rv.wait_until_done()

Command:

.wait_until_done()

Command
Syntax:

.wait_until_done()

Python
Code
Sample:

rv.wait_until_done()


Sample program

for i in range(4):

••rv.forward(.5,"M")

••rv.left()

••rv.wait_until_done()

••rv.color_rgb(255,0,0)

••sleep(1)

••rv.color_off()

 

Note: This program works well for the task of turning on the Rover’s LED to red for 1 second and then off after each left turn in the square.

Range:

N/A

Describe:

Program waits until TI-Rover stops moving.

Result:

Program waits until TI-Rover stops moving.

Type or
Addressable
Component:

Setting

 

while not path_done()

Command:

while not path_done()

Command Syntax:

while not path_done()

Method:

rv.while not path_done()

Range:

 

Describe:

Runs the commands in the "while" loop until the Rover is finished with all movement.

Result:

The path_done() function returns a value of 0 or 1 depending on whether the Rover is moving (0) or finished with all movement (1).

Errors:

 

Type or
Addressable Component:

 

 

rv.position()

Command:

.position()

Command
Syntax:

.position(x,y)

.position(x,y,heading,”unit”)

Python
Code
Samples:

rv.position(xxx, yyy [, hhh, “degrees”|”radians”|”grads”])

Range:

N/A

Describe:

Sets the coordinate position and optionally the heading of the Rover on the virtual grid.

Result:

Rover configuration is updated.

Type or
Addressable
Component:

Setting

 

rv.grid_origin()

Command:

.grid_origin()

Command
Syntax:

.grid_origin()

Python
Code
Samples:

rv.grid_origin()

Range:

N/A

Describe:

Sets RV as being at current grid origin point of (0,0). The "heading" is set to 0.0 resulting in the current position of the RV now set to pointing down a virtual x-axis toward positive x values.

Result:

 

Type or
Addressable
Component:

Setting

 

rv.grid_m_unit()

Command:

.grid_m_unit()

Command
Syntax:

.grid_m_unit(scale_value)

Python
Code
Samples:

rv.grid_m_unit(nnn)

Range:

N/A

Describe:

Set the size of a “grid unit” on the virtual grid. Default is 0.1 meters per unit grid. A scale_value of 0.2 means 5 units per meter (20 cm per unit grid). A scale_value of 0.05 means 20 units per meter (5 cm per unit grid).

Set the size of a "grid unit" on the virtual grid. Default is 10 units per meter (100 mm / 10 cm per unit grid). A value of 5 means 5 units per meter or 200 mm / 20 cm per unit grid). A value of 20 means 20 units per meter, or 50 mm / 5 cm per.

Result:

 

Type or
Addressable
Component:

Setting

 

rv.path_clear()

Command:

.path_clear()

Command
Syntax:

.path_clear()

Python
Code
Samples:

rv.path_clear()

Range:

N/A

Describe:

Clears any pre-existing path / waypoint information. Recommended before doing a sequence of movement operations where waypoint / path-list information.

Result:

 

Type or
Addressable
Component:

Setting

 

rv.zero_gyro()

Command:

.zero_gyro()

Command
Syntax:

.zero_gyro()

Python
Code
Samples:

rv.zero_gyro()

Range:

N/A

Describe:

Resets the Rover gyro to 0.0 angle and clears the left and right wheel encoder counts.

Result:

 

Error:

 

Type or
Addressable
Component:

Setting