> For the complete documentation index, see [llms.txt](https://docs.revrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.revrobotics.com/first-global/2026/sb-code/programming-initialization.md).

# Programming - Initialization

Before our program begins, we need to do some set up first as part of initialization. This section of code will run when "Init" is pressed on the Driver Hub and before "Play" is pressed!

<figure><img src="/files/nplnb235QIJftp0Dgi6p" alt=""><figcaption><p>Initialization code for the FGC Starter Bot</p></figcaption></figure>

## Motor Settings

The motors on the drivetrain are mirrored with each other. If we set them to run the same direction then the robot will only spin in a circle! Instead, we will set the left motor to run in reverse allowing us to drive normally.&#x20;

As for the motors used for the flywheel, because we plan to use velocity we need the encoders enabled to receive proper measurements.

<figure><img src="/files/lY6qDqB3aMbaK2CpC9cf" alt=""><figcaption><p>Motor Settings for the FGC Starter Bot</p></figcaption></figure>

## Variables

We will be using velocity[^1] for the flywheel motors. We can create a variable for our target velocity to make it easy to make adjustments later if we increase or decrease the target.&#x20;

<figure><img src="/files/vdO4LUtMUgKQqeTwxZxd" alt=""><figcaption><p>targetVelocity Variable </p></figcaption></figure>

Velocity is measured in ticks per second.&#x20;

[^1]: the measurement of speed in a certain direction of motion
