# LEGO EV3 specific blocks

{% hint style="info" %}
This article is automatically translated from Russian by Google Translator.
{% endhint %}

Specialized blocks for LEGO EV3 are divided into several categories:

1. [Action](/en/ev3/blocks.md#action-blocks) — blocks that perform some action on the robot: turn on motors, play sound, etc.
2. [Waiting](/en/ev3/blocks.md#waiting-blocks) — units waiting for some event to occur: certain sensor readings, button presses, etc.
3. [Drawings on the display](/en/ev3/blocks.md#drawing-on-the-display) — blocks used to display graphics and text on the screen
4. [Line Leader](/en/ev3/blocks.md#line-leader) — blocks for the advanced "Line Leader" sensor.

&#x20;For the blocks available for all platforms, see the article "[Common Blocks](/en/studio/programming-visual/blocks.md)".

## Action blocks

| Icon                                                                | Name                                                                     | Description                                                                                                                                          |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M56ZRIGIyABvvSEiPaP" alt="" data-size="original"> | [Send Message to Thread](/en/ev3/blocks.md#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). |
| <img src="/files/-M56ZpP-xMkrCJzlWy2g" alt="" data-size="original"> | [Beep](/en/ev3/blocks.md#beep)                                           | Play a fixed-frequency sound on the robot.                                                                                                           |
| <img src="/files/-M56_YY9Mb1unPVpNTP-" alt="" data-size="original"> | [Play Tone](/en/ev3/blocks.md#play-tone)                                 | Play the sound on the robot at a given frequency and duration.                                                                                       |
| <img src="/files/-M56_oRM69Bvm9OffV6R" alt="" data-size="original"> | [Motors Forward](/en/ev3/blocks.md#motors-forward)                       | Turn on the motors on the set ports with the set power.                                                                                              |
| <img src="/files/-M56aBmIClnllm_-6VC5" alt="" data-size="original"> | [Motors Backward](/en/ev3/blocks.md#motors-backward)                     | Turn on the motors in reversing mode on the set ports with the set power.                                                                            |
| <img src="/files/-M56aNWEcLNeAGndA_Jc" alt="" data-size="original"> | [Stop Motors](/en/ev3/blocks.md#stop-motors)                             | Turn off the motors on the specified ports.                                                                                                          |
| <img src="/files/-M56adQRXqQQiwHAf6jp" alt="" data-size="original"> | [Clear Encoder](/en/ev3/blocks.md#clear-encoder)                         | Reset the number of motor revolutions.                                                                                                               |
| <img src="/files/-M56b4AQB2RenK0T6IEa" alt="" data-size="original"> | [LED](/en/ev3/blocks.md#led)                                             | Set the color of the LED on the front of the robot.                                                                                                  |
| <img src="/files/-M56b_N79x_eDyefstGU" alt="" data-size="original"> | [Send Mail](/en/ev3/blocks.md#send-mail)                                 | Send an email to another robot.                                                                                                                      |
| <img src="/files/-M56gPpHxUzrJvJjFZOh" alt="" data-size="original"> | [Calibrate Gyroscope](/en/ev3/blocks.md#calibrate-gyroscope)             | Sets the gyroscope to 0 at the current position.                                                                                                     |
| <img src="/files/-M56g_6pugsURUfZTlmq" alt="" data-size="original"> | [Start Compass Calibration](/en/ev3/blocks.md#start-compass-calibration) | Starts the compass calibration programmatically.                                                                                                     |
| <img src="/files/-M56gch1iKoUi44y4WgY" alt="" data-size="original"> | [Stop Compass Calibration](/en/ev3/blocks.md#stop-compass-calibration)   | Finishes the compass calibration.                                                                                                                    |
| <img src="/files/-M56h0cVvMcI0yI7Emrw" alt="" data-size="original"> | [Read RGB into Variables](/en/ev3/blocks.md#read-rgb-into-variables)     | Read RGB in a variable.                                                                                                                              |

### Send Message to Thread

![Send Message to Thread](/files/-M575t7n3wL8LN_Wd1-v)

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

![Beep](/files/-M5761MdnQM5kzx69D6i)

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

![Play Tone](/files/-M5767JFAJMBQYqnOpQK)

Play the sound on the robot at a given frequency and duration. Аналогичен блоку «[Гудок](/en/ev3/blocks.md#gudok)», но позволяет также задавать параметры звука.

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**

![Motors Forward](/files/-M576Hfx-IJxgD_yOdxh)

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**

![Motors Backward](/files/-M576MqpspZH-nKKM25H)

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**

![Stop Motors](/files/-M577jU7Z5R3i1Afe6C7)

Turn off the motors on the specified ports.

### **Clear Encoder**

![Clear Encoder](/files/-M577nnYIL5HkD794GIF)

Reset the number of motor revolutions.

### **LED**

![LED](/files/-M57D5baj--9ZyA1As9J)

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

### **Send Mail**

![Send Mail](/files/-M57DJBEXSV9tDRyaLqV)

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

![Calibrate Gyroscope](/files/-M57EwOxXexLOsPZRo1V)

Sets the gyroscope to 0 at the current position.

### Start Compass Calibration

![Start Compass Calibration](/files/-M57DyHldjpCofUU0VaC)

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

![Stop Compass Calibration](/files/-M57E3ooGPPinlUQhxZK)

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 into Variables](/files/-M57E7JM9yOozgi6_Bp4)

Read RGB in a variable.

## Waiting Blocks

| Icon                                                                | Name                                                                         | Description                                                                                                                               |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M56n4MuW-BCvqWswTTK" alt="" data-size="original"> | [Receive Message from Thread](/en/ev3/blocks.md#receive-message-from-thread) | Wait to receive a message from another parallel task.                                                                                     |
| <img src="/files/-M56lmpH0qhorUUuyodd" alt="" data-size="original"> | [Wait for Touch Sensor](/en/ev3/blocks.md#wait-for-touch-sensor)             | Wait until the touch sensor is triggered.                                                                                                 |
| <img src="/files/-M56lsyq0qWiZpZ-zRuJ" alt="" data-size="original"> | [Wait for Encoder](/en/ev3/blocks.md#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.       |
| <img src="/files/-M56m-m_JXOkH3oo3KHE" alt="" data-size="original"> | [Wait for Color](/en/ev3/blocks.md#wait-for-color)                           | Wait for the color sensor in color recognition mode to return the specified color.                                                        |
| <img src="/files/-M56m65AoBcGfoo4wr6Y" alt="" data-size="original"> | [Wait for Color Intensity](/en/ev3/blocks.md#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.  |
| <img src="/files/-M56mGb43Mdi4YCroFk0" alt="" data-size="original"> | [Wait for Light](/en/ev3/blocks.md#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. |
| <img src="/files/-M56mVXeNHE0ffFkNXqM" alt="" data-size="original"> | [Wait for Range Sensor](/en/ev3/blocks.md#wait-for-range-sensor)             | Wait until the distance returned by the ultrasonic distance sensor is comparable to that specified in the Distance parameter value.       |
| <img src="/files/-M56mf01zgfYBuR6FY8C" alt="" data-size="original"> | [Wait for Button](/en/ev3/blocks.md#wait-for-button)                         | Wait for the button on the robot body to be pressed.                                                                                      |
| <img src="/files/-M56miTUBXtXfBhDcWVs" alt="" data-size="original"> | [Wait for Sound Sensor](/en/ev3/blocks.md#wait-for-sound-sensor)             | Wait until the volume read by the microphone on the specified port is above or below the set value.                                       |
| <img src="/files/-M56mmNtRvdUBR9JdqCB" alt="" data-size="original"> | [Wait for Gyroscope](/en/ev3/blocks.md#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.       |
| <img src="/files/-M56mshfe32GzFr4r84D" alt="" data-size="original"> | [Wait for Mail Receiving](/en/ev3/blocks.md#wait-for-mail-receiving)         | Saves a message from another robot to a given variable.                                                                                   |

### Receive Message from Thread

![Receive Message from Thread](/files/-M57GACe2xicMDkFMBK_)

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 for Touch Sensor](/files/-M57GFPRMwfyQ9evZOK-)

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 for Encoder](/files/-M57GMaMQrXcY-jLqI40)

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 Color](/files/-M57GPqxO39aWZvhas3o)

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 for Color Intensity](/files/-M57GhlJTu1J8fHqUnGf)

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%).&#x20;
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 for Light](/files/-M57GlnGwPI6OkCgl-Zr)

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 for Range Sensor](/files/-M57GunvskQgaV-BioFj)

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 Button](/files/-M57GyZ_9wPexgPBmLRh)

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

### Wait for Sound Sensor

![Wait for Sound Sensor](/files/-M57H1fWGdnU7wdS-ScD)

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

### Wait for Gyroscope

![Wait for Gyroscope](/files/-M57H5iGABLMjMBX3aYm)

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

![Wait for Mail Receiving](/files/-M57H87yKxae9RY4UjbB)

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                                                                |
| ------------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------------------------------- |
| <img src="/files/-M56rtOMDfR6g5_1jNQ0" alt="" data-size="original"> | [Print Text](/en/ev3/blocks.md#print-text)         | Prints the specified line at the specified location on the robot's screen. |
| <img src="/files/-M56rvm1r4MX2P7TF2-7" alt="" data-size="original"> | [Clear Screen](/en/ev3/blocks.md#clear-screen)     | Erase everything that is drawn on the screen.                              |
| <img src="/files/-M56ryU8rtduaz4XN9H9" alt="" data-size="original"> | [Draw Rectangle](/en/ev3/blocks.md#draw-ractangle) | Draw a rectangle on the screen.                                            |
| <img src="/files/-M56s0jqvpuPyPcDg62-" alt="" data-size="original"> | [Draw Pixel](/en/ev3/blocks.md#draw-pixel)         | Draw a point on the screen at the specified coordinates.                   |
| <img src="/files/-M56s3LT-PexnnVwsPGL" alt="" data-size="original"> | [Draw Line](/en/ev3/blocks.md#draw-line)           | Draw a segment on the screen.                                              |
| <img src="/files/-M56s5vWVZWtEpKXZ6LW" alt="" data-size="original"> | [Draw Circle](/en/ev3/blocks.md#draw-circle)       | Draw a circle on the screen with a given center and a given radius.        |

### Print Text

![Print Text](/files/-M57HrZCkhjhwI638GHH)

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

![Clear Screen](/files/-M57HxGK9OFvO_CEfPQI)

Erase everything that is drawn on the screen.

### Draw Rectangle

![Draw Rectangle](/files/-M57I-7Ir4RsGtEXmeSb)

Draw a rectangle on the screen.

Parameters:

1. &#x20;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 Pixel](/files/-M57I11TlMetL8j134ng)

Draw a point on the screen at the specified coordinates.

### Draw Line

![Draw Line](/files/-M57I36aRtLURLo60H13)

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 Circle](/files/-M57I5TjiYgb74Ro14jr)

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                                                                                               |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M56vuvs6niKvdoKFCMa" alt="" data-size="original"> | [Calibrate White](/en/ev3/blocks.md#calibrate-white)                     | Calibrates the white threshold for the sensor.                                                            |
| <img src="/files/-M56vy2TejfRFkTlsF1z" alt="" data-size="original"> | [Calibrate Black](/en/ev3/blocks.md#calibrate-black)                     | Calibrates the black threshold for the sensor.                                                            |
| <img src="/files/-M56w-kTOPpnlJeNwCyA" alt="" data-size="original"> | [Calibrate PID](/en/ev3/blocks.md#calibrate-pid)                         | Sets the sensor setpoint (middle of the sensor above the line), P/(P factor), I/(I factor), D/(D factor). |
| <img src="/files/-M56wF7L0LMv3Vz_jEaq" alt="" data-size="original"> | [Sleep Line Leader](/en/ev3/blocks.md#sleep-line-leader)                 | Sets the line sensor to power save mode.                                                                  |
| <img src="/files/-M56wM7qiLQ8vlFp219g" alt="" data-size="original"> | [Wake Up Line Leader](/en/ev3/blocks.md#wake-up-line-leader)             | Includes a line sensor for operation.                                                                     |
| <img src="/files/-M56wa_OQ7cyWR7j5Zfe" alt="" data-size="original"> | [Read Average to Variable](/en/ev3/blocks.md#read-average-to-variable)   | Reads the weighted average value into a variable.                                                         |
| <img src="/files/-M56wRyA_fYdi6eh4mTJ" alt="" data-size="original"> | [Read Sensor to Array](/en/ev3/blocks.md#read-sensor-to-array)           | Read values from the sensor (eight values).                                                               |
| <img src="/files/-M56wempv1KkjevuIuCZ" alt="" data-size="original"> | [Read Steering to Variable](/en/ev3/blocks.md#read-steering-to-variable) | Reads the control value into a variable.                                                                  |

### Calibrate White

![Calibrate White](/files/-M57HIU_O9PZbEfCGfMA)

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

### Calibrate Black

![Calibrate Black](/files/-M57HLTWqC4W5pC7WBLF)

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

### Calibrate PID

![Calibrate PID](/files/-M57HO47MzQdj-LKk8g-)

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

### Sleep Line Leader

![Sleep Line Leader](/files/-M57HTxfkitJVVQudSX8)

Sets the line sensor to power save mode.

### Wake Up Line Leader

![Wake Up Line Leader](/files/-M57HWZf_pkR3VblmjpG)

Includes a line sensor for operation.

### Read Average to Variable

![Read Average to Variable](/files/-M57HZqFNl5oxW7cGGky)

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 Sensor to Array](/files/-M57Hc3Ku-twMRg4VJE4)

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

### Read Steering to Variable

![Read Steering to Variable](/files/-M57HhcgnnGrahpgSkrf)

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).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.trikset.com/en/ev3/blocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
