# What is an OpMode?

## OpModes

**OpModes** (or operational modes) are computer programs that are used to customize or specify the behavior of a robot. Simply put, these are the programs we create!

The Robot Controller on the Control Hub stores and executes the OpModes. The Driver Hub then allows us to initialize, start, or stop these OpModes.&#x20;

In the SDK, there are two types of op modes: **autonomous (Auto)** and **teleoperation (TeleOp)**. Both types of op modes have initialization, start, and stop features on the Driver Hub.&#x20;

<figure><img src="/files/6pYiAbeYYfYsf1etl5C8" alt=""><figcaption></figcaption></figure>

You can see in the image above that the left arrow (green) allows for the selection of Auto programs while the right arrow (blue) shows the TeleOp list.&#x20;

Below shows an example of how your list of programs may appear:

<figure><img src="/files/RWtV16YiQg6WaFr3kU7E" alt=""><figcaption></figcaption></figure>

### Autonomous Timer

When an Auto mode is selected, a 30 second timer will appear next to the play button to count down while this program is active. This can be toggle off for testing!

<figure><img src="/files/YHec5FoOXrO86xxGEb3O" alt=""><figcaption><p>Countdown timer enabled</p></figcaption></figure>

<figure><img src="/files/QXXtCxEkIy7Y3oh3O8uf" alt=""><figcaption><p>Countdown timer disabled</p></figcaption></figure>

While an autonomous program is running, the robot will act independently without input from a gamepad. At the end of the 30 second timer the robot will automatically stop the code. If needed, a program can also be stopped early same as while running a TeleOp program.

<figure><img src="/files/gLRFZ0o4KotNMqtVK7yr" alt=""><figcaption></figcaption></figure>

### Selecting Auto vs. TeleOp When Making a Program:

For OnBot Java, what type of OpMode you are creating is selected while making a new file.

**Robot Controller App Version 10.2 and earlier:**

<figure><img src="/files/kxC95L4rGDjIxK6XLZRJ" alt=""><figcaption><p>Pre-10.3 menu for creating a new program</p></figcaption></figure>

**Robot Controller App Version 10.3 and newer:**&#x20;

<figure><img src="/files/n9kToRlkBy9iDZIadJbg" alt=""><figcaption><p>Version 10.3 and newer menu for creating a new program</p></figcaption></figure>

{% hint style="info" %}
As of version 10.3, when using a sample code in OnBot Java the "OpMode Type" may be automatically selected. This can still be changed before creating the OpMode.
{% endhint %}


---

# 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://docs.revrobotics.com/duo-control/hello-robot-java/where-to-program/what-is-an-opmode.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.
