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