code stringlengths 16 126 | text stringlengths 16 67 |
|---|---|
drivetrain.driveFor(forward, DISTANCE, inches); | Drive forward for a specific distance. |
drivetrain.driveFor(reverse, DISTANCE, inches); | Drive backward for a specific distance. |
drivetrain.turnFor(left, DEGREES, degrees); | Turn left a specific number of degrees. |
drivetrain.turnFor(right, DEGREES, degrees); | Turn right a specific number of degrees. |
motor1.spin(forward, SPEED, rpm); | Spin motor at a specific speed. |
motor1.spin(reverse, SPEED, rpm); | Reverse motor at a specific speed. |
drivetrain.stop(); | Stop the drivetrain. |
armMotor.spin(forward); wait(DURATION, seconds); armMotor.stop(); | Lift arm for a specific duration. |
while(inertialSensor.heading(degrees) < ANGLE) { drivetrain.turn(left); } drivetrain.stop(); | Rotate using inertial sensor to a specific angle to the left. |
while(inertialSensor.heading(degrees) > ANGLE) { drivetrain.turn(right); } drivetrain.stop(); | Rotate using inertial sensor to a specific angle to the right. |
flywheelMotor.spin(forward, VELOCITY, velocityUnits::rpm); | Spin the flywheel at a specific velocity. |
flywheelMotor.stop(); | Stop the flywheel. |
intakeMotor.spin(forward, SPEED, velocityUnits::pct); | Run the intake forward. |
intakeMotor.spin(reverse, SPEED, velocityUnits::pct); | Reverse the intake. |
intakeMotor.stop(); | Stop the intake. |
matchLoaderMotor.spin(forward, SPEED, velocityUnits::pct); wait(DURATION, seconds); matchLoaderMotor.stop(); | Activate the match loader to load a ball. |
piston.set(true); | Extend a piston to push an object. |
piston.set(false); | Retract a piston. |
piston.toggle(); | Toggle a piston's state. |
flywheelMotor.spin(forward, VELOCITY, velocityUnits::rpm); wait(DURATION, seconds); flywheelMotor.stop(); | Run the flywheel for a specific duration then stop. |
intakeMotor.spin(forward, INTAKE_SPEED, velocityUnits::pct); matchLoaderMotor.spin(forward, LOADER_SPEED, velocityUnits::pct); | Spin the intake and match loader simultaneously to intake and load. |
inertialSensor.calibrate(); while(inertialSensor.isCalibrating()) { wait(100, msec); } | Calibrate the inertial sensor. |
drivetrain.setVelocity(SPEED, velocityUnits::pct); | Set the drivetrain velocity to a specific value. |
flywheelMotor.setVelocity(LONG_DISTANCE_SPEED, velocityUnits::rpm); flywheelMotor.spin(forward); | Set the flywheel velocity for a long-distance shot. |
flywheelMotor.setVelocity(SHORT_DISTANCE_SPEED, velocityUnits::rpm); flywheelMotor.spin(forward); | Set the flywheel velocity for a short-distance shot. |
No dataset card yet
- Downloads last month
- 4