All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Programming - Intake and Flywheel

Intake

Bumper controls for the intake

The intake is controlled using the bumpers on the gamepad. The left bumper intakes game pieces into the robot while right bumper reverses to output back onto the field.

Flywheels and Feeder

The flywheel on the Starter Bot is controlled using two motors. These motors need to move at the same time when activated.

Flywheel and feeder code

When cross is pressed, the flywheels will both spin up to the set target velocity. Then the Core Hex controlling the feeder will wait until both motors are within 100 ticks of the target velocity before activating and feeding game pieces into the flywheel to launch.

Manual Feeder Control

Manual feeder controls

The Core Hex motor controlling the feeder into the flywheel can be manually controlled using the Dpad on the gamepad to assist with agitating game pieces and clearing jams.

Stopping the Motors

If the robot is not receiving input from the Dpad or Cross button, then all three motors will return to 0 power.

To aid with fine tuning the flywheels, we can add telemetry to see the current velocity on the Driver Hub. The velocity can be changed by modifying the targetVelocity variable.

Programming Starter Bot

If your team is new to FIRST Global Challenge, or in need of a review, we strongly recommend checking out our updated before diving in!

To begin, let's take a look at the configuration and actuators used in this year's design.

Device Type
Hub
Port Number
Name

Flywheel Telemetry

Resetting motors to 0 power
Flywheel Telemetry

Expansion Hub

0

rightDrive

REV Robotics Ultraplanetary HD Hex Motor

Expansion Hub

1

leftDrive

REV Robotics Ultraplanetary HD Hex Motor

Expansion Hub

2

climbMotor

REV Robotics Ultraplanetary HD Hex Motor

Control Hub

0

bottomFlywheel

REV Robotics Ultraplanetary HD Hex Motor

Control Hub

1

topFlywheel

REV Robotics Core Hex Motor

Control Hub

2

coreHex

REV Robotics Ultraplanetary HD Hex Motor

Control Hub

3

intakeMotor

Before getting started with programming, we needed to create a configuration file. Below is an overview of how the robot is configured for the TeleOp code to function as expected:

Right click the file below and select "save link as" if the download button does not appear. To put this configuration file on your robot, drag this file into the "FIRST" folder of your Control Hub's file system.

The 2026 FGC Starter Bot uses arcade drive controlled by the left joystick. The robot's forward and reverse motions, along with turning, are all controlled by the left stick together!

Gamepad Input
Function

Left Joystick

Arcade Drive (forward/back, turn)

Triangle

Climb Forward

Square

Climb Reverse

More information on programming gamepads for use with your robot can be found at Hello Robot - Using Gamepads.

Getting Started!

Hello Robot Programming Guide

REV Robotics Ultraplanetary HD Hex Motor

Configuration

Configuration File Download

Wiring Diagram

Gamepad Setup

The REV USB PS4 Compatible Gamepad (REV-31-2983) has two remappable M-buttons on the back side of the controller. For this program, we advise reprogramming them to be the Circle and Square buttons!

.

Blocks Program Download:

Programming Walkthrough Video

909B
FGC2026.xml
Open
16KB
FGCStarterBot2026.blk
Open

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!

Initialization code for the FGC Starter Bot

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.

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

Motor Settings for the FGC Starter Bot

Variables

We will be using velocity 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.

Velocity is measured in ticks per second.

Programming - Drive and Climber

The FGC Starter Bot is designed for arcade drive. The left joystick controls all movement for the robot's drivetrain, forward/back and turning!

The inputs from the joystick will be stored in the set up X and Y variables. However, unlike the targetVelocity constant variable set up during initialization, these variables will update every time the program loops.

Then these variables are used to calculate how much power to give each motor based on the current movement of the joystick.

The FGC Starter Bot uses a single motor for climbing. On the gamepad, pressing

triangle
will allow the robot to ascend up the brace while
square
reverses the motor to aid with adjusting while climbing.

Arcade Drive

To learn more about the variables used and the equation for deciding motor power, check out the !

Climber Control

FGC Starter Bot Arcade Drive
FGC Starter Bot Climb Code

Cross

Activate Flywheel and Feeder

Left Bumper

Intake Game Pieces

Right Bumper

Outtake Game Pieces

Please see the guide here for how to remap
targetVelocity Variable
Hello Robot's walkthrough