Programming - Initialization
Last updated
Was this helpful?
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!

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.

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.
Last updated
Was this helpful?
Was this helpful?

