Blockly Definitions
This manual explains the Blockly blocks available in Synthiam ARC's JavaScript visual programming environment.
Use this page as a quick reference when building robot behaviors with drag-and-drop blocks.
Blockly lets you create programs visually by snapping blocks together. Each category contains a different type of block, such as logic, loops, movement, camera, servos, audio, variables, and more.
- Statement blocks perform actions, such as moving a robot or waiting for speech.
- Value blocks return data, such as a number, text, true/false, or a sensor reading.
- Input sockets allow you to place one block inside another.
- Mutator blocks have a small gear icon that lets you add more options, such as extra conditions or text items.
Logic
Logic blocks help your program make decisions based on conditions.
Block type: controls_if
Checks a condition and runs the blocks inside the do section when the condition is true.
You can expand this block using the gear icon to add more else if or else sections.
Block type: logic_compare
Compares two values and returns either true or false.
Operators: =, !=, <, <=, >, >=
Block type: logic_operation
Combines two true/false values using and or or.
- AND means both conditions must be true.
- OR means either condition can be true.
Block type: logic_negate
Reverses a true/false value. If something is true, it becomes false. If it is false, it becomes true.
Block type: logic_boolean
A simple true or false value block.
Loops
Loop blocks repeat actions until a condition is met, a counter finishes, or forever.
Block type: controls_repeat_ext
Repeats the enclosed blocks the specified number of times.
Block type: break
Immediately exits the current loop.
Block type: controls_whileUntil
Repeats blocks while a condition is true, or until a condition becomes true.
Block type: repeat_for
Counts from one number to another using a variable and a step amount.
Block type: loop_forever
Repeats the blocks forever until a Break or Halt block stops execution.
Block type: labelblock
Creates a named marker in your program that other blocks can jump to.
Block type: gotoblock
Jumps execution to a label with the matching name.
Audio
Audio blocks let your robot speak, play sounds, and wait for speech recognition results.
Block type: play_audio
Plays a sound from the project's soundboards and continues immediately.
Block type: play_audio_wait
Plays a sound and waits until it finishes before continuing.
Block type: audio_stop
Stops audio currently playing from the EZ-B speaker.
Block types: say, say_wait, sayWithIndex, say_waitWithIndex
Speaks text through an EZ-B speaker. Some versions continue right away, while the Wait versions pause until speech finishes.
Block types: say_pc, say_pc_wait
Speaks text through the computer's sound device.
Block types: wait_for_speech, wait_for_speech_ext
Waits for one of the expected phrases to be spoken and returns the detected result, or timeout if nothing is recognized in time.
Block type: wait_for_speech_range
Waits for a spoken number within a specific range.
Block type: wait_for_any_speech
Waits for any speech input and returns what was heard, or timeout.
Block type: wait_for_any_number_speech
Waits for any spoken number, including negative and decimal values.
Camera
Camera blocks help your program detect, follow, capture, and react to what the robot sees.
Block type: camera_tracking
Sets the camera tracking mode, such as Face, Object, Motion, Glyph, or color tracking.
Block types: movement_tracking, servo_tracking
Turns robot movement tracking or servo tracking on or off so the robot can follow tracked targets.
Block types: wait_for_face, wait_for_color, wait_for_glyph, wait_for_object, wait_for_multi_color, wait_for_ycbcr_color
These blocks pause execution until the selected target is detected by the camera.
Block type: take_photo
Captures a photo from the camera and saves it to the My Pictures folder.
Block type: tweet_image
Posts the current camera image to a configured Twitter account with a message.
Block type: camera_command
Sends a ControlCommand() to the camera device using one of the configured project commands.
The Camera category also includes pre-built compare blocks for checking things such as:
- Whether the camera is tracking
- Whether the tracking type is Face
- Whether the tracking type is Object
- Whether the tracking type is Color
- Whether the tracking type is MultiColor
- Whether the tracking type is Motion
- Whether the tracking type is Glyph
Functions
Functions let you organize reusable logic into named blocks of behavior.
Block type: procedures_callreturn
Calls a function and returns a value back to the current block.
Block type: procedures_callnoreturn
Calls a function that performs actions but does not return a value.
Block type: return
Ends the current function and optionally returns a value.
Math
Math blocks provide numbers, calculations, rounding, constraints, and random values.
Block type: math_number
A number constant block.
Block type: math_arithmetic
Performs addition, subtraction, multiplication, division, or power operations.
Block type: random
Returns a random number between a minimum and maximum value.
Block types: math_single, math_trig, math_constant
Provides more advanced math operations such as square root, logarithms, sine, cosine, tangent, pi, and more.
Block type: math_number_property
Checks if a number is even, odd, prime, positive, negative, whole, or divisible by another value.
Block type: math_change
Adds a value to an existing variable.
Block type: math_round
Rounds a number normally, up, or down.
Block type: math_constrain
Keeps a number within a minimum and maximum range.
Movement
Movement blocks control robot driving actions such as forward, reverse, turning, and stopping.
Block types: move_forward, move_reverse
Moves the robot continuously using left and right wheel speed values.
Block types: move_forward_time, move_reverse_time
Moves the robot for a specified number of milliseconds.
Block types: move_right, move_left
Turns the robot left or right using a speed value.
Block type: move_stop
Stops all robot movement immediately.
Servo
Servo blocks control servo movement, speed, acceleration, limits, and Auto Position actions.
Block types: autoPositionNoLoop, autoPositionNoLoopByActionName, autoPositionLoop, autoPositionLoopByActionName, auto_position_background
Run Auto Position actions by dropdown or by name, either waiting, looping for a duration, or running in the background.
Block type: move_servo
Moves a servo on a selected port to a target position.
Block types: getservo, getservorealtime
Reads the current servo position either from cached data or directly from the hardware in real time.
Block types: servo_speed, setAcceleration, setVelocity
Controls how the servo moves and how quickly it gets there.
Block types: setMinPositionLimit, setMaxPositionLimit
Prevents a servo from moving outside a safe range.
Block type: release
De-energizes the servo so it can move freely.
Text
Text blocks create strings, combine text, print messages, and prompt users for input.
Block type: text
A text constant block.
Block type: text_length
Returns the number of characters in a string or items in an array.
Block type: text_print
Prints a value to the output console.
Block types: text_join, text_append
Combines strings together or adds more text to a variable.
Block type: wait_for_prompt
Shows a prompt to the user and waits for a response or timeout.
Ports
Port blocks read or control EZ-B digital and analog ports.
Block types: get_digital, set_digital
Reads or writes a true/false value on a digital port.
Block types: get_adc, get_adc_12
Reads analog values from ADC ports with standard or higher precision.
Block type: port_pwm
Sets a PWM output value on a digital port.
Sensor
Sensor blocks provide readings from attached hardware and the EZ-B controller.
Block type: get_ping
Reads distance from an ultrasonic sensor using trigger and echo ports.
Block type: get_voltage
Returns the EZ-B controller voltage.
Block type: get_cpu_temp
Returns the EZ-B controller CPU temperature.
Utility
Utility blocks perform general-purpose actions such as waiting, sending commands, running custom code, or stopping the script.
Block type: sleep
Pauses the script for the specified number of milliseconds.
Block type: control_command
Sends a ControlCommand() to another skill or control in the project.
Block type: raw_javascript
Inserts raw JavaScript directly into the generated code.
Block type: halt
Immediately stops script execution.
Variables
Variables store values that your program can use and change while it runs.
Block type: variables_get
Returns the current value stored in a variable.
Block type: variables_set
Assigns a value to a variable.
Block type: clear_variable
Clears or resets the selected variable.