Code Editor

Scripting is available in ARC using Blockly, JavaScript, Python, and EZ-Script. All scripting editors will support any of the three programming languages, including Blockly. The software also presents intellisense scripting input, which means the commands are displayed as you type.


Scripting Controls

Within the Add Skills dialog of ARC is a section for scripting skill controls. The skill controls within this category are standalone scripting skill controls. Keep in mind that nearly all skills have scripting capability within their configuration dialog as well.


Edit Scripts

Within the configuration dialog of nearly all skill controls is the ability to edit scripts to define specific behaviors, such as when to start tracking using the camera. The script editors are input fields with a pencil icon to the right. In this example, we are displaying the configuration dialog for the WiiMote.


Editor Dialog

The editor dialog consists of an input section on the left and reference assistance on the right. The window can be resized or maximized and will remember the last size for future use.


Intelligent Code Completion (IntelliSense)

As you begin typing the script, the intelligent code complete will present a selection of functions based on your input. You may use the arrow Up/Down keys to select the appropriate command or continue typing. Pressing the ESC key will hide the dialog.


Port Summary

The page of the next tab from the Script Manual is the Port Summary. This page displays how the ports of the EZ-B are being used. The summary is manually entered in the Project Details section. Creating a port summary helps you know what is connected to the EZ-B ports. You will define what is connected to each port, for example, Left Arm Servo or Right Leg Servo. Configure the port summary with either the Robot Designer or Properties tab of the robot project. These are located in the My Robot top menu under Project.


Cheat Sheet

The third tab of the editor dialog is the Cheat Sheet. This is a very powerful tab, as it automatically generates code for you based on the project configuration. This tab analyzes the project and determines what functions are available from each control. The ControlCommand() script function is how you programmatically set parameters between ARC Controls. The Cheat Sheet tab will display all available ControlCommand() parameters for all controls in your project. Clicking on a ControlCommand() in the list will be added to your script editor.

Alternatively, you can right-click in the editor for a quicker menu list of control commands.


Console

The fourth tab is a temporary Console for Output while testing your script. The console will display the output of a Print() function or any compiler errors. When you press the Run button to test your script, the output will be displayed in this Console tab.


Variables

The last tab is the variables page. This will list all variables that are currently assigned in the compiler. EZ-Script variables are global, so all controls and scripts can share the variables. To access global Script variables in JavaScript, use the getVar() and setVar() methods. The value of each variable is also displayed, including the values within arrays. Clicking on a variable name will add the text to your script editor. 

*Note: Remember that you must define a variable before it can be used. For example, if you wish to check the value of a variable using an IF condition, then you must have already had the variable assigned with a value. Think of it this way, you can't check a value if the variable is empty (i.e. not defined).


Clipboard Functions

Microsoft Windows includes clipboard functions native to all text controls. By selecting the text, the keyboard shortcut CTRL-C can be used to copy the text. Later, the keyboard shortcut CTRL-V can be used to paste the text from the clipboard. Additionally, there is also the ability to CUT text, which removes the text from the editor into the clipboard. To CUT text, select the text and press the shortcut CTRL-X. Later, the same pasting shortcut can be used to paste the CUT text (CTRL-V).

CTRL-X (cut)
CTRL-C (copy)
CTRL-V (paste)

*Note: Be sure to hold the CTRL (control) key while pressing the secondary key (X, C or V). Do not let go of the CTRL (control) key until you have pressed the secondary key. Once you have pressed the secondary key, simply let go of both keys and the action has been executed.


Choose Programming Language

Synthiam has developed the ARC software to scale between beginner and advanced users. Our mission is to make robot programming accessible and increase the likelihood of success. We have included multiple programming languages in ARC to be used based on your skill level.

Roboscratch

(Very easy)

Designed for learning the basics of programming, RoboScratch introduces a programming interface exclusive to ARC. With RoboScratch, function blocks are added to the workspace to create a sketch. There are blocks such as wait for the camera to see an object, wait for speech, or execute a movement action. Link blocks to instruct robots to perform behaviors and complete tasks.

Blockly

(Easy)

Blockly programming provides the user with graphical blocks that represent programming functions or subroutines. Blockly allows users to access advanced technologies creatively without needing to know the programming syntax by typing with a keyboard.

Scripting

(Intermediate)

Syntax programming is available in three scripting languages JavaScript, EZ-Script, and Python. All robot skills support any of the scripting languages to interact with each other for custom behaviors. By using the powerful ControlCommand messaging system, have events from robot skills send triggers to other robot skills within the project.

Programming

(Advanced)

Compile programs and libraries which interface with the ARC API. Make robot skills to distribute in the robot skill store, or simply use the existing framework to accelerate robot development. Access existing robot skills or the ARC API framework with C++, C, C#, VB, and more.


When editing a robot skill configuration, there may be options to add code. The code dialog window in ARC provides a tab option to select what language to use for this option. Multiple languages can be used throughout a project - you do not need to use the same language.