LogoLogo
TRIK StudioTRIKLego EV3Lego NXT
English
English
  • TRIK help
  • TRIK Studio
    • About TRIK Studio
      • How to find out the version of TRIK Studio
    • Getting started and creating a project
    • TRIK Studio interface
      • TRIK Studio main menu
      • Working with graphs
      • How to open robot settings
      • How to change TRIK Studio interface language
    • TRIK Studio settings
    • 2D model
      • 2D model tuning
      • Adding restrictions to the 2D Model
        • Restrictions setting examples
    • Visual programming
      • Adding and removing blocks
      • Common blocks
      • Links between blocks
      • Syntax of expressions in the blocks
        • TRIK Studio language types
          • Array
        • TRIK Studio language tokens
        • TRIK Studio language operators
        • Constants
        • Sensor variables
        • Built-in functions
      • Property editing
      • Subprograms
    • Textual programming
    • Exercises
    • External tools
      • PuTTY
      • WinSCP
    • TRIK Studio shortcuts
    • Antivirus conflicts
      • Avast antivirus blocks TRIK Studio. What to do?
  • TRIK Studio Junior
    • About TRIK Studio Junior
      • How to find out the version of TRIK Studio Junior
    • Getting started and creating a project in TRIK Studio Junior
    • TRIK Studio Junior interface
      • How do I replace the "Character movement" image?
    • TRIK Studio Junior settings
    • Visual programming in TRIK Studio Junior
      • Adding and removing blocks in TRIK Studio Junior
      • Blocks in TRIK Studio Junior
      • Links between blocks in TRIK Studio Junior
      • Syntax of expressions in the blocks in TRIK Studio Junior
      • Property editing in TRIK Studio Junior
      • Subprograms in TRIK Studio Junior
    • Exercises in TRIK Studio Junior
  • INTEGRATIONS
    • PyCharm
      • Running a 2D model in TRIK Studio from PyCharm
    • Sublime Text
      • Running a 2D model in TRIK Studio from Sublime Text
      • Uploading programs to several TRIK robots from Sublime Text
    • VSCode
      • Running a 2D model in TRIK Studio from VSCode
      • Uploading programs to several TRIK robots from VSCode
  • TRIK controller
    • About the TRIK controller
      • Screenshot of the TRIK controller screen
    • TRIK controller firmware
      • How to find out the firmware version of the TRIK controller?
    • TRIK controller menu
    • Connecting to the TRIK controller via Wi-Fi
      • Connecting the TRIK controller to a computer and smartphone
      • Connecting the TRIK controller to TRIK Studio
      • Interaction of TRIK controllers
        • An example of solving a problem on the interaction of two robots
    • Connecting to the TRIK controller using UART
    • Launching and uploading programs to the TRIK controller
    • Programming TRIK with the visual programming language
      • TRIK specific blocks
      • Sensory variables for the TRIK controller
    • TRIK controller programming in Python and JavaScript
      • Object «brick»
        • Class «accelerometer»
        • Class «battery»
        • Class «colorSensor»
        • Class «display»
        • Class «encoder»
        • Class «gyroscope»
        • Class «keys»
        • Class «led»
        • Class «lineSensor»
        • Class «motor»
        • Class «objectSensor»
        • Class «sensor»
      • Object «script»
      • Object «mailbox»
      • Object «gamepad»
      • Object «Threading»
      • Function getPhoto
      • Function include
    • TRIK controller web interface
    • Connecting devices to TRIK and working with them
      • Connecting and working with the video module
      • Testing devices connected to the TRIK controller
      • Configuring the operation of a USB camera with a TRIK controller
      • Capturing images with TRIK camera and using them in TRIK Studio
      • Working with battery and charger
  • LEGO EV3 Controller
    • About LEGO EV3
    • Connecting a LEGO EV3 Controller to TRIK Studio
    • LEGO EV3 specific blocks
    • Sensory Variables for the LEGO EV3 Controller
    • Launching and uploading programs to the LEGO EV3
  • LEGO NXT Controller
    • About LEGO NXT
    • LEGO NXT Controller Firmware
    • Connecting a LEGO NXT Controller to TRIK Studio
    • LEGO NXT specific blocks
    • Sensory Variables for the LEGO NXT Controller
    • LEGO NXT C Programming
    • Launching and uploading programs to the LEGO NXT
  • Quadcopter Geoscan Pioneer
    • About quadcopter Geoscan Pioneer
    • Geoscan Pioneer specific blocks
  • TRIK Gamepad
    • About TRIK Gamepad
      • TRIK Gamepad App
      • TRIK Gamepad Utility
    • Robot control from the remote control
  • Feedback
    • Actions in case of TRIK Studio or TRIK controller malfunction
    • Ask a Question
    • trikset.com
Powered by GitBook
On this page
  • Action blocks
  • Send Message to Thread
  • Beep
  • Play Tone
  • Motors Forward
  • Motors Backward
  • Stop Motors
  • Clear Encoder
  • LED
  • Send Mail
  • Calibrate Gyroscope
  • Start Compass Calibration
  • Stop Compass Calibration
  • Read RGB into Variables
  • Waiting Blocks
  • Receive Message from Thread
  • Wait for Touch Sensor
  • Wait for Encoder
  • Wait for Color
  • Wait for Color Intensity
  • Wait for Light
  • Wait for Range Sensor
  • Wait for Button
  • Wait for Sound Sensor
  • Wait for Gyroscope
  • Wait for Mail Receiving
  • Drawing on the display
  • Print Text
  • Clear Screen
  • Draw Rectangle
  • Draw Pixel
  • Draw Line
  • Draw Circle
  • Line Leader
  • Calibrate White
  • Calibrate Black
  • Calibrate PID
  • Sleep Line Leader
  • Wake Up Line Leader
  • Read Average to Variable
  • Read Sensor to Array
  • Read Steering to Variable

Was this helpful?

Export as PDF
  1. LEGO EV3 Controller

LEGO EV3 specific blocks

PreviousConnecting a LEGO EV3 Controller to TRIK StudioNextSensory Variables for the LEGO EV3 Controller

Last updated 4 years ago

Was this helpful?

This article is automatically translated from Russian by Google Translator.

Specialized blocks for LEGO EV3 are divided into several categories:

  1. — blocks that perform some action on the robot: turn on motors, play sound, etc.

  2. — units waiting for some event to occur: certain sensor readings, button presses, etc.

  3. — blocks used to display graphics and text on the screen

  4. — blocks for the advanced "Line Leader" sensor.

For the blocks available for all platforms, see the article "".

Action blocks

Icon

Name

Description

Sends this message to the parallel task with the specified identifier (the identifier must be specified when creating the task in the "Fork" block).

Play a fixed-frequency sound on the robot.

Play the sound on the robot at a given frequency and duration.

Turn on the motors on the set ports with the set power.

Turn on the motors in reversing mode on the set ports with the set power.

Turn off the motors on the specified ports.

Reset the number of motor revolutions.

Set the color of the LED on the front of the robot.

Send an email to another robot.

Sets the gyroscope to 0 at the current position.

Starts the compass calibration programmatically.

Finishes the compass calibration.

Read RGB in a variable.

Send Message to Thread

Sends this message to the parallel task with the specified identifier (the identifier must be specified when creating the task in the "Fork" block).

The message can be any expression.

Beep

Play a fixed-frequency sound on the robot.

Parameters:

  1. Whether to wait for the sound to end or go straight to the next block. Valid values are "true", "false".

  2. Playback volume.

Play Tone

Parameters:

  • Frequency (Hz).

  • Duration (ms).

  • Whether to wait for the sound to end or go to the next block immediately. Valid values - true, false.

  • Playback volume (from 0 to 100%).

Motors Forward

Turn on the motors on the set ports with the set power. The ports are set by the letters A, B, or C, separated by commas.

The power is set as a percentage by a number from -100 to 100, if a negative value is set, the motor turns on in reverse mode.

The motors have different modes of operation: braking mode and sliding mode (indicated by a red or green rectangle on the block, respectively). The modes affect the way the motor responds to a command - braking mode stops the motor when shut down, the sliding mode allows the motor to crank through its inertia.

Motors Backward

Turn on the motors in reversing mode on the set ports with the set power. The parameters are the same as for the "Motors Forward" block.

Stop Motors

Turn off the motors on the specified ports.

Clear Encoder

Reset the number of motor revolutions.

LED

Set the color of the LED on the front of the robot.

Send Mail

Send an email to another robot. If the recipient's name is not filled in, the message will be sent to all connected robots.

Calibrate Gyroscope

Sets the gyroscope to 0 at the current position.

Start Compass Calibration

Starts the compass calibration programmatically. To calibrate the compass, the robot must turn in place more than 540° in one direction and then in the opposite direction. After the turns, the "Stop Compass Calibration" block must be added.

Stop Compass Calibration

Finishes the compass calibration. The calibration result is returned in a variable. A nonzero result means a successful calibration.

Read RGB into Variables

Read RGB in a variable.

Waiting Blocks

Icon

Name

Description

Wait to receive a message from another parallel task.

Wait until the touch sensor is triggered.

Wait until the RPM counter reading on the specified motor reaches the RPM Limit value specified in the "RPM Limit" parameter value.

Wait for the color sensor in color recognition mode to return the specified color.

Wait until the value returned by the color sensor on the specified port is comparable to the value specified in the Intensity parameter.

Wait until the value returned by the light sensor on the specified port is comparable to the value specified in the Percentage parameter.

Wait until the distance returned by the ultrasonic distance sensor is comparable to that specified in the Distance parameter value.

Wait for the button on the robot body to be pressed.

Wait until the volume read by the microphone on the specified port is above or below the set value.

Wait until the value returned by the gyroscope on the specified port is comparable to the value specified in the "Value" parameter.

Saves a message from another robot to a given variable.

Receive Message from Thread

Wait to receive a message from another parallel task.

When a message is received, it will be assigned to the variable specified in the block.

The "Wait for message" property allows you to specify what to do if the message queue is empty: wait for a new message to arrive or continue working by assigning an empty string to the variable.

The message is automatically converted to the same type as the receiver variable. For example, if you send a number as a string, it will be accepted as a number.

Wait for Touch Sensor

Wait until the touch sensor is triggered.

The parameter specifies the number of the port to which the sensor is connected. Valid values: 1, 2, 3, 4.

Wait for Encoder

Wait until the RPM counter reading on the specified motor reaches the RPM Limit value specified in the "RPM Limit" parameter value.

Parameters:

  1. Port - the name of the port to which the motor is connected (A, B, or C).

  2. Read value - the operation that will be used for comparison with the entered RPM limit.

  3. RPM limit.

Wait for Color

Wait for the color sensor in color recognition mode to return the specified color.

Parameters:

  1. Color.

  2. Port - the number of the port to which the color sensor is connected.

Wait for Color Intensity

Wait until the value returned by the color sensor on the specified port is comparable to the value specified in the Intensity parameter.

Parameters:

  1. Intensity (0 to 100%).

  2. Port - number of the port to which the color sensor is connected.

  3. Read value - the operation that will be used to compare with the entered intensity.

Wait for Light

Wait until the value returned by the light sensor on the specified port is comparable to the value specified in the Percentage parameter.

Parameters:

  1. Percentages (from 0 to 100%).

  2. Port - the number of the port to which the color sensor is connected.

  3. Read value - the operation that will be used to compare with the Percent value.

Wait for Range Sensor

Wait until the distance returned by the ultrasonic distance sensor is comparable to that specified in the Distance parameter value.

Parameters:

  1. Distance (in centimeters, from 0 to 255).

  2. Port - number of the port to which the distance sensor is connected.

  3. Read value - the operation that will be used for comparison with the entered distance.

Wait for Button

Wait for the button on the robot body to be pressed.

Wait for Sound Sensor

Wait until the volume read by the microphone on the specified port is above or below the set value.

Wait for Gyroscope

Wait until the value returned by the gyroscope on the specified port is comparable to the value specified in the "Value" parameter.

Wait for Mail Receiving

Saves a message from another robot to a given variable. If there is no message, the robot waits for the message to arrive if the flag is set. Otherwise, the variable is set to the default value.

Drawing on the display

Icon

Name

Description

Prints the specified line at the specified location on the robot's screen.

Erase everything that is drawn on the screen.

Draw a rectangle on the screen.

Draw a point on the screen at the specified coordinates.

Draw a segment on the screen.

Draw a circle on the screen with a given center and a given radius.

Print Text

Prints the specified line at the specified location on the robot's screen.

The default value of the Text property is treated as a pure string, and it will be displayed that way. To make the system assume that this is a textual expression (which can be useful, for example, when debugging variable values), check the "Calculate" checkbox in the Property Editor.

Clear Screen

Erase everything that is drawn on the screen.

Draw Rectangle

Draw a rectangle on the screen.

Parameters:

  1. X, Y - coordinates of the upper left corner.

  2. The width of the rectangle.

  3. The height of the rectangle.

  4. Update the picture (true or false).

Draw Pixel

Draw a point on the screen at the specified coordinates.

Draw Line

Draw a segment on the screen.

Parameters:

  1. X1, Y1 - coordinates of the beginning of the segment.

  2. X2, Y2 - coordinates of the end of the segment.

  3. Update the picture (true or false).

Draw Circle

Draw a circle on the screen with a given center and a given radius.

Parameters:

  1. X, Y - coordinates of the center of the circle.

  2. The radius of the circle.

  3. Update the picture (true or false).

Line Leader

Icon

Name

Description

Calibrates the white threshold for the sensor.

Calibrates the black threshold for the sensor.

Sets the sensor setpoint (middle of the sensor above the line), P/(P factor), I/(I factor), D/(D factor).

Sets the line sensor to power save mode.

Includes a line sensor for operation.

Reads the weighted average value into a variable.

Read values from the sensor (eight values).

Reads the control value into a variable.

Calibrate White

Calibrates the white threshold for the sensor. Must be on white.

Calibrate Black

Calibrates the black threshold for the sensor. Should be on black.

Calibrate PID

Sets the sensor setpoint (middle of the sensor above the line), P/(P factor), I/(I factor), D/(D factor).

Sleep Line Leader

Sets the line sensor to power save mode.

Wake Up Line Leader

Includes a line sensor for operation.

Read Average to Variable

Reads the weighted average value into a variable.

The value is calculated within the sensor, where each of the eight sensors is taken with a factor, and the average is calculated.

A value between 0 and 80 is expected (-1 is an error).

Read Sensor to Array

Read values from the sensor (eight values). Values from 0 to 100. 0 is black, 100 is white.

Read Steering to Variable

Reads the control value into a variable. The value is calculated inside the sensor and can be used immediately for motors.

A value from -100 to 100 is expected (-101 is an error).

Play the sound on the robot at a given frequency and duration. Аналогичен блоку «», но позволяет также задавать параметры звука.

Common Blocks
Action
Waiting
Drawings on the display
Line Leader
Гудок
Send Message to Thread
Beep
Play Tone
Motors Forward
Motors Backward
Stop Motors
Clear Encoder
LED
Send Mail
Calibrate Gyroscope
Start Compass Calibration
Stop Compass Calibration
Read RGB into Variables
Receive Message from Thread
Wait for Touch Sensor
Wait for Encoder
Wait for Color
Wait for Color Intensity
Wait for Light
Wait for Range Sensor
Wait for Button
Wait for Sound Sensor
Wait for Gyroscope
Wait for Mail Receiving
Print Text
Clear Screen
Draw Rectangle
Draw Pixel
Draw Line
Draw Circle
Calibrate White
Calibrate Black
Calibrate PID
Sleep Line Leader
Wake Up Line Leader
Read Average to Variable
Read Sensor to Array
Read Steering to Variable
Send Message to Thread
Beep
Play Tone
Motors Forward
Motors Backward
Stop Motors
Clear Encoder
LED
Send Mail
Calibrate Gyroscope
Start Compass Calibration
Stop Compass Calibration
Read RGB into Variables
Receive Message from Thread
Wait for Touch Sensor
Wait for Encoder
Wait for Color
Wait for Color Intensity
Wait for Light
Wait for Range Sensor
Wait for Button
Wait for Sound Sensor
Wait for Gyroscope
Wait for Mail Receiving
Print Text
Clear Screen
Draw Rectangle
Draw Pixel
Draw Line
Draw Circle
Calibrate White
Calibrate Black
Calibrate PID
Sleep Line Leader
Wake Up Line Leader
Read Average to Variable
Read Sensor to Array
Read Steering to Variable