Programming - Overview
Initialization
During initialization, after "Init" is pressed on the Driver Hub but BEFORE "Play" is pressed, there are a few things we can set up for our code.

First are our motor settings. One of the drivetrain motors must be reversed to prevent spinning in a circle. For the 2026-27 Starter Bot, the rightDrive motor is reversed. Then our flywheel need to be set to use the encoder since we will be using velocity.
Then we will set up our variables. There is only one variable in the default code, targetVelocity, which sets the velocity the flywheel will try to reach for launching pollen from near the field perimeter. If your team decides to change where you want to launch from, this variable can be updated here or an additional one can be added!
OpMode Overview
After play is pressed, the looping portion of the OpMode will begin. But first, the pollenServo will be set itself to the up position (1). This helps to ensure the extension is out of the way as the robot drives until the servo is activated.

Main Loop
The loop for the OpMode may appear pretty short, but this is thanks to the use of functions! Each of the main systems have been separated into their own functions for easy viewing and adjustments to the program.

Functions
intakeControls
This is the code used to control the Core Hex intake for the pollen.
pollenPoker
This is the code used to control the servo's position for poking pollen out of a flower
arcadeDrive
This is the code for driving the robot. Look here if you plan to change to Split Arcade, Mecanum, or Tank Drive
flywheelControls
This larger function contains the code for the flywheel system, including both manual controls and the auto sequence for launching pollen.
Telemetry
Telemetry allows us to receive information on the Driver Hub from the robot. The telemetry included provides a readout of the current velocity for the flywheel to help with troubleshooting and making adjustments to the code.

Last updated
Was this helpful?


