# Launching and uploading programs to the LEGO EV3

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

To work with the LEGO EV3 controller, in the TRIK Studio settings, go to "Robots" and select the LEGO EV3 platform.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYhZXA1mdmImIeO5_b%2F94%201%20En%20EV3-robots%204.png?alt=media\&token=7e0f538a-4850-4785-97c6-ae3c9295bbca)

There are several options for executing programs for the LEGO EV3 controller:

* Step-by-step interpretation of a diagram with the simulation of the robot's behavior on a two-dimensional model.
* Loading the program on the robot and its further autonomous execution without communication with the computer.

## Interpretation with the simulation of robot behavior <a href="#id-2d" id="id-2d"></a>

{% hint style="info" %}
In 2D Model Robot mode, commands are not sent to the robot, but are executed step by step for the virtual model displayed on the screen. See "[2D Model](https://help.trikset.com/en/studio/2d-model)" for more information.
{% endhint %}

1\. Turn on the two-dimensional model mode.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYhdPnzTOIlBgoHUsf%2F94%202%20En%20ev3-2d-1%204.png?alt=media\&token=109341f1-e308-434c-af1c-facf3c89f400)

2\. Click the "Execute" button.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYhidEVtro8sDluJAn%2F94%203%20En%20ev3-2d-2%204.png?alt=media\&token=a222cdb7-b67d-4fe9-bab9-c26064213dea)

3\. The 2D model window will open and the program will start.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYhppAuM9U7oPcIMYr%2F94%204%20En%20ev3-2d-3%203.gif?alt=media\&token=9dcfd135-b262-4492-91c7-c33d19af7b4e)

4\. When you switch to edit mode, you can track the steps of the program's execution.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYi-5jJL1QwKhcZ-Oe%2F94%205%20En%20ev3-2d-4%203.gif?alt=media\&token=272441d4-e6a4-4137-b355-b9db5fea4e96)

## Upload to controller <a href="#upload" id="upload"></a>

From TRIK Studio you can download a ready-made program to the robot to execute it autonomously in the future without communication with a computer.

{% hint style="warning" %}
**Warning!** You need [Java](https://java.com/ru/download/) software to download programs to the controller.
{% endhint %}

1\. Enable Bluetooth or USB offline execution mode (depending on the desired type of connection to the robot to download the program).&#x20;

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYi8V6Kyiujztyv_ml%2F94%206%20En%20ev3-upload-1%204.png?alt=media\&token=80fa4d87-a512-4b31-a27f-fa9c0209389b)

2\. Click the "Run Program" button.

The program will generate code in the internal EV3 language, load it onto the robot and run it immediately for execution.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYiCD-CGxtq5agfd5p%2F94%207%20En%20ev3-upload-2%204.png?alt=media\&token=2f0aaeb5-a8c5-49fc-8c3e-397fd43fd19d)

3\. If you only want to download a program without running it, use the "Download Program" button.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYiIlL0cgzJsssqt8R%2F94%208%20En%20ev3-upload-3%204.png?alt=media\&token=c51ccb51-1d8b-478d-9e1b-55eec89a9a17)

**\*\*\***

Experts in EV3 can look at the code generated in the internal EV3 language with the "Generate to EV3 bytecode" button.

![](https://2483351831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-9YMGCK0ySSnTAiseS%2F-MUYXyQxbiPC_BIXnHxD%2F-MUYiSqZYMRCNSKIXzRP%2F94%209%20En%20ev3-bytecode%204.png?alt=media\&token=18b6f44e-6324-4c2e-a0de-93aa0c801f0f)
