Prerequisite: Use the Send "Connect RV" Command First
The "CONNECT RV" command needs to be used first when using the Rover. The "CONNECT RV" command configures the TI-Innovator™ Hub software to work with the TI-Innovator™ Rover.
It establishes the connections to the various devices on the Rover – two motors, two encoders, one gyroscope, one RGB LED and one color sensor. It also clears the various counters and sensor values. The optional ‘MOTORS’ parameter configures only the motors and allows direct control of motors without the additional peripherals.
CONNECT RV - initializes the hardware connections.
•
Connects RV and inputs and outputs built into the RV.
•
Resets the Path and the Grid Origin.
•
Sets the units per meter to default value of 10. Default Grid unit = 10cm.
Named RV Subsystems
The RV object contains several subsystems that are directly addressed by name. These subsystems consist of the wheels, and sensors that let the Rover sense the world.
The subsystems are listed by name in the following table.
Subsystem Name
Description of Subsystem
RV
The RV object as a whole.
RV.COLOR
The tri-color RGB LED on the top surface of the Rover can be controlled through user programs to display any color combination.
RV.COLORINPUT
The color sensor is on the bottom of the Rover and is used to detect the color of the surface.
RV.RANGER
The front-facing ultrasonic distance sensor. Returns measurements in meters. ~10.00 meters means no obstacle was detected.
RV.ENCODERGYRO
The rotary encoders – one on each motor – measure the distance traveled by the Rover.
The left and right encoder, coupled with the gyroscope and operating time information.
RV.GYRO
The gyroscope is used to maintain the heading of Rover while it’s in motion. It can also be used to measure the change in angle during turns.
RV.MOTOR.L
Left wheel motor and control for direct control (advanced) use.
RV.MOTOR.R
Right wheel motor and control for direct control (advanced) use.
RV.MOTORS
Both the LEFT and RIGHT motor, managed as a single object for direct control (advanced) use.
Rover Command Categories
The Rover commands fall into two categories:
1.
Queued execution: All of the Rover motion commands – FORWARD, BACKWARD, LEFT, RIGHT, ANGLE – are queued on the TI-Innovator Hub. They may execute at a future time.
2.
Immediate execution: Other commands – like the ones to read the sensors or set the RGB LED on the Rover – are executed immediately.
This means that certain statements in your program will execute before statements that appear earlier in the program especially if the latter commands are part of the queued family.
For example, in the program below, the RGB LED will turn RED before the Rover stops moving:
To change color after a "FORWARD" movement, use "TIME" parameter with "WAIT".
Send "RV FORWARD TIME 5"
WAIT 5
Send "SET RV.COLOR 255 0 255"
RV Commands, Code Samples, and Syntax
The following examples show how various commands for the RV are used. Anywhere a SET command is used, the SET may be left off (optional use).
Code Samples
When you see "Code Sample" in a command table, this "Code Sample" may be copied and pasted as is to send to your graphing calculator to use in your calculations.