# TRIK controller programming in Python and JavaScript

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

## Creating a text program

Read the article about creating a new text program and generating a diagram to code:

{% content-ref url="/pages/-M0Npt6Rsejz5XCUWJsR" %}
[Textual programming](/en/studio/programming-code.md)
{% endcontent-ref %}

## Programming in Python and JavaScript

The functionality of the runtime environment is accessed through predefined objects and functions.

### Objects

| Object                                                     | Description                                                                                                      |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| [brick](/en/trik/programming-code/object-brick.md)         | Represents the TRIK controller and provides access to the robot's devices.                                       |
| [script](/en/trik/programming-code/object-script.md)       | Represents methods of controlling the execution of the script and provides access to operating system functions. |
| [mailbox](/en/trik/programming-code/object-mailbox.md)     | It implements communication between robots in the network by means of the mailbox mechanism.                     |
| [gamepad](/en/trik/programming-code/object-gamepad.md)     | Serves to work with the remote control.                                                                          |
| [Threading](/en/trik/programming-code/object-threading.md) | Provides management of parallel threads.                                                                         |

### Functions

| Function                                                         | Description                                                                                                                                                                                                            |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [getPhoto](/en/trik/programming-code/function-getphoto.md)       | Returns a one-dimensional array of bytes containing the pixels of the rgb32-formatted image taken from the camera.                                                                                                     |
| [include(“path”)](/en/trik/programming-code/function-include.md) | Allows you to use functions implemented by the user in other files. It is assumed for writing your own libraries. As a passed parameter you must specify the full system path to the file with the required functions. |


---

# 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/trik/programming-code.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.
