App Studio (Code.org) Robot Control Apps

As mentioned in the Robot API section, the Sample Robot Controller App includes pre-built functions that simply sending Robot Commands to the robot.

Building (Modifying) your Robot Controller App

Once a participant has completed the steps describing the [Sample Robot App](/robot-controller-sample-app), the controller app can then be modified for greater control during the challenges. For example, depending on the Challenge Mode, it may be useful to have the ability to drive the robot in a more autonomous mode.

Note that the runRobotCommand runs the instruction(s) you set in the variable robotCommand. The next section below describes all the possible instructions. Note that you can provide multiple instructions at once by separating the instructions with commas.

Example

robotCommand = "FWD-255-1000,TURNR-150-2000"; runRobotCommand();

This example is calling the runRobotCommand with two instructions. The first instruction FWD-255-1000 says to go forward at full speed (255) for 1 seconds (1000 ms).

The second instruction (separated by comma) TURNR-150-2000 says to turn right at medium speed (150) for 2 seconds (2000 ms).

Edit this page on GitHub Updated at Wed, Feb 16, 2022