File size: 3,469 Bytes
3a9e1e3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
[
{
"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);"
}
] |