<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="intake_var_currentR3">currentR3</variable><variable id="intake_var_reverse">reverse</variable><variable id="intake_var_stopButton">stopButton</variable><variable id="intake_var_startButton">startButton</variable><variable id="intake_var_ready">ready</variable><variable id="intake_var_power">power</variable><variable id="intake_var_on">on</variable><variable id="intake_var_previousR3">previousR3</variable></variables><block type="procedures_defnoreturn" id="intake_0117" x="30" y="30"><field name="NAME">runOpMode</field><statement name="STACK"><block type="procedures_callnoreturn" id="intake_0088"><mutation name="configureIntake"/><next><block type="comment" id="student_intake_init"><field name="COMMENT">Use INIT to observe, not move
While INIT is active, the program reads R3, remembers its current value, reports readiness, and keeps motor power at zero. Remembering a held button prevents START from mistaking that old press for a new request.
For example: Hold R3 through INIT and START. The intake stays OFF. Release R3, then press it again to make the first new press.
Think first: Does START turn a held R3 into a fresh press?</field><next><block type="controls_whileUntil" id="intake_0105"><field name="MODE">WHILE</field><value name="BOOL"><block type="linearOpMode_opModeInInit" id="intake_0090"/></value><statement name="DO"><block type="variables_set" id="intake_0092"><field name="VAR" id="intake_var_currentR3">currentR3</field><value name="VALUE"><block type="gamepad_getProperty_Boolean" id="intake_0091"><field name="IDENTIFIER">gamepad1</field><field name="PROP">RightStickButton</field></block></value><next><block type="variables_set" id="intake_0094"><field name="VAR" id="intake_var_previousR3">previousR3</field><value name="VALUE"><block type="variables_get" id="intake_0093"><field name="VAR" id="intake_var_currentR3">currentR3</field></block></value><next><block type="variables_set" id="intake_0096"><field name="VAR" id="intake_var_ready">ready</field><value name="VALUE"><block type="misc_callJava_return" id="intake_0095"><mutation methodLookupString="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport intakeReady() boolean" fullClassName="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport" simpleName="CalibrationBlocksSupport" parameterCount="0" returnType="boolean" color="289" heading="Calibration lesson" comment="" tooltip="" accessMethod="callJava_boolean" convertReturnValue="" createDropdownFunctionName=""/><field name="CLASS_NAME">CalibrationBlocksSupport</field><field name="METHOD_NAME">intakeReady</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0099"><value name="KEY"><block type="text" id="intake_0098"><field name="TEXT">readiness</field></block></value><value name="TEXT"><block type="misc_callJava_return" id="intake_0097"><mutation methodLookupString="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport intakeStatus() java.lang.String" fullClassName="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport" simpleName="CalibrationBlocksSupport" parameterCount="0" returnType="java.lang.String" color="289" heading="Calibration lesson" comment="" tooltip="" accessMethod="callJava_String" convertReturnValue="" createDropdownFunctionName=""/><field name="CLASS_NAME">CalibrationBlocksSupport</field><field name="METHOD_NAME">intakeStatus</field></block></value><next><block type="telemetry_update" id="intake_0100"><next><block type="dcMotor_setProperty_Number" id="intake_0102"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">Power</field><value name="VALUE"><block type="math_number" id="intake_0101"><field name="NUM">0</field></block></value><next><block type="linearOpMode_sleep_Number" id="intake_0104"><value name="MILLISECONDS"><block type="math_number" id="intake_0103"><field name="NUM">20</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><next><block type="linearOpMode_waitForStart" id="intake_0106"><next><block type="controls_whileUntil" id="intake_0112"><field name="MODE">WHILE</field><value name="BOOL"><block type="linearOpMode_opModeIsActive" id="intake_0107"/></value><statement name="DO"><block type="procedures_callnoreturn" id="intake_0108"><mutation name="intakeControls"/><next><block type="procedures_callnoreturn" id="intake_0109"><mutation name="intakeTelemetry"/><next><block type="linearOpMode_sleep_Number" id="intake_0111"><value name="MILLISECONDS"><block type="math_number" id="intake_0110"><field name="NUM">10</field></block></value></block></next></block></next></block></statement><next><block type="comment" id="student_intake_stop"><field name="COMMENT">Clear the request and end safely
B or Start clears ON and requests zero, taking priority over forward and reverse. Releasing those buttons does not restore the old ON selection. Driver Station STOP ends the program; exit cleanup requests zero again and closes the intake session. Zero power is not a guarantee that mechanical motion ends instantly.
For example: While ON, press B → ON becomes false and power becomes zero. To run forward again, release the stop input and make a fresh R3 press while ready.
Think first: Which control should the supervisor use to end the trial rather than just clear ON?</field><next><block type="dcMotor_setProperty_Number" id="intake_0115"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">Power</field><value name="VALUE"><block type="math_number" id="intake_0114"><field name="NUM">0</field></block></value><next><block type="misc_callJava_noReturn" id="intake_0116"><mutation methodLookupString="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport intakeEnd() void" fullClassName="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport" simpleName="CalibrationBlocksSupport" parameterCount="0" returnType="void" color="289" heading="Calibration lesson" comment="" tooltip="" accessMethod="callJava" convertReturnValue="" createDropdownFunctionName=""/><field name="CLASS_NAME">CalibrationBlocksSupport</field><field name="METHOD_NAME">intakeEnd</field></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="intake_0118" x="30" y="818"><field name="NAME">configureIntake</field><statement name="STACK"><block type="comment" id="student_intake_setup"><field name="COMMENT">Start with a known OFF state
Setup gives the motor a direction, BRAKE behavior, and RUN_WITHOUT_ENCODER mode, then requests zero power. This mode controls power directly rather than holding a measured speed. The ON latch starts false: think of it as the program's memory of whether forward intake is selected.
For example: Selecting the program prepares its settings. It does not turn the intake ON.
Think first: If the motor is ready but the ON latch is false, should the intake run?</field><next><block type="dcMotor_setProperty_Direction" id="intake_0072"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">Direction</field><value name="VALUE"><block type="dcMotor_typedEnum_direction" id="intake_0071"><field name="DIRECTION">REVERSE</field></block></value><next><block type="dcMotor_setProperty_ZeroPowerBehavior" id="intake_0074"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">ZeroPowerBehavior</field><value name="VALUE"><block type="dcMotor_typedEnum_zeroPowerBehavior" id="intake_0073"><field name="ZERO_POWER_BEHAVIOR">BRAKE</field></block></value><next><block type="dcMotor_setProperty_RunMode" id="intake_0076"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">Mode</field><value name="VALUE"><block type="dcMotor_typedEnum_runMode" id="intake_0075"><field name="RUN_MODE">RUN_WITHOUT_ENCODER</field></block></value><next><block type="dcMotor_setProperty_Number" id="intake_0078"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">Power</field><value name="VALUE"><block type="math_number" id="intake_0077"><field name="NUM">0</field></block></value><next><block type="misc_callJava_noReturn" id="intake_0079"><mutation methodLookupString="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport intakeBegin() void" fullClassName="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport" simpleName="CalibrationBlocksSupport" parameterCount="0" returnType="void" color="289" heading="Calibration lesson" comment="" tooltip="" accessMethod="callJava" convertReturnValue="" createDropdownFunctionName=""/><field name="CLASS_NAME">CalibrationBlocksSupport</field><field name="METHOD_NAME">intakeBegin</field><next><block type="variables_set" id="intake_0081"><field name="VAR" id="intake_var_on">on</field><value name="VALUE"><block type="logic_boolean" id="intake_0080"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="intake_0083"><field name="VAR" id="intake_var_previousR3">previousR3</field><value name="VALUE"><block type="logic_boolean" id="intake_0082"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="intake_0085"><field name="VAR" id="intake_var_power">power</field><value name="VALUE"><block type="math_number" id="intake_0084"><field name="NUM">0</field></block></value><next><block type="variables_set" id="intake_0087"><field name="VAR" id="intake_var_ready">ready</field><value name="VALUE"><block type="logic_boolean" id="intake_0086"><field name="BOOL">FALSE</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="intake_0119" x="30" y="1224"><field name="NAME">intakeControls</field><statement name="STACK"><block type="variables_set" id="intake_0002"><field name="VAR" id="intake_var_currentR3">currentR3</field><value name="VALUE"><block type="gamepad_getProperty_Boolean" id="intake_0001"><field name="IDENTIFIER">gamepad1</field><field name="PROP">RightStickButton</field></block></value><next><block type="variables_set" id="intake_0004"><field name="VAR" id="intake_var_reverse">reverse</field><value name="VALUE"><block type="gamepad_getProperty_Boolean" id="intake_0003"><field name="IDENTIFIER">gamepad1</field><field name="PROP">DpadDown</field></block></value><next><block type="variables_set" id="intake_0006"><field name="VAR" id="intake_var_stopButton">stopButton</field><value name="VALUE"><block type="gamepad_getProperty_Boolean" id="intake_0005"><field name="IDENTIFIER">gamepad1</field><field name="PROP">B</field></block></value><next><block type="variables_set" id="intake_0008"><field name="VAR" id="intake_var_startButton">startButton</field><value name="VALUE"><block type="gamepad_getProperty_Boolean" id="intake_0007"><field name="IDENTIFIER">gamepad1</field><field name="PROP">Start</field></block></value><next><block type="comment" id="student_intake_ready"><field name="COMMENT">Check whether a request can be used
Each control loop checks readiness before choosing power. The motor controller must be ARMED and engaged, and the hub must be open, engaged, and responding. If readiness fails, the program clears ON and requests zero. An SDK health value of UNKNOWN can be normal; an actual fault such as UNHEALTHY or CLOSED blocks operation.
For example: A lost hub connection clears a previous ON selection. Restoring the connection alone does not turn the intake forward again.
Think first: If the other readiness checks pass and SDK health says UNKNOWN, is that word alone a failure?</field><next><block type="variables_set" id="intake_0011"><field name="VAR" id="intake_var_ready">ready</field><value name="VALUE"><block type="misc_callJava_return" id="intake_0010"><mutation methodLookupString="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport intakeReady() boolean" fullClassName="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport" simpleName="CalibrationBlocksSupport" parameterCount="0" returnType="boolean" color="289" heading="Calibration lesson" comment="" tooltip="" accessMethod="callJava_boolean" convertReturnValue="" createDropdownFunctionName=""/><field name="CLASS_NAME">CalibrationBlocksSupport</field><field name="METHOD_NAME">intakeReady</field></block></value><next><block type="variables_set" id="intake_0013"><field name="VAR" id="intake_var_power">power</field><value name="VALUE"><block type="math_number" id="intake_0012"><field name="NUM">0</field></block></value><next><block type="controls_if" id="intake_0041"><mutation elseif="1" else="1"/><value name="IF0"><block type="logic_operation" id="intake_0019"><field name="OP">OR</field><value name="A"><block type="logic_negate" id="intake_0015"><value name="BOOL"><block type="variables_get" id="intake_0014"><field name="VAR" id="intake_var_ready">ready</field></block></value></block></value><value name="B"><block type="logic_operation" id="intake_0018"><field name="OP">OR</field><value name="A"><block type="variables_get" id="intake_0016"><field name="VAR" id="intake_var_stopButton">stopButton</field></block></value><value name="B"><block type="variables_get" id="intake_0017"><field name="VAR" id="intake_var_startButton">startButton</field></block></value></block></value></block></value><value name="IF1"><block type="variables_get" id="intake_0022"><field name="VAR" id="intake_var_reverse">reverse</field></block></value><statement name="DO0"><block type="variables_set" id="intake_0021"><field name="VAR" id="intake_var_on">on</field><value name="VALUE"><block type="logic_boolean" id="intake_0020"><field name="BOOL">FALSE</field></block></value></block></statement><statement name="DO1"><block type="comment" id="student_intake_reverse"><field name="COMMENT">Let DOWN override forward
Holding D-pad DOWN requests −0.25 power and clears the ON latch, provided readiness passes and no stop input is held. Reverse is a hold control, not a toggle. Because it clears ON, releasing DOWN leaves the motor OFF instead of restarting forward.
For example: From ON: hold DOWN → reverse at −0.25; release DOWN → zero; make a fresh R3 press → forward at +0.25.
Think first: Why does DOWN release not return to forward?</field><next><block type="variables_set" id="intake_0025"><field name="VAR" id="intake_var_on">on</field><value name="VALUE"><block type="logic_boolean" id="intake_0024"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="intake_0027"><field name="VAR" id="intake_var_power">power</field><value name="VALUE"><block type="math_number" id="intake_0026"><field name="NUM">-0.25</field></block></value></block></next></block></next></block></statement><statement name="ELSE"><block type="comment" id="student_intake_edge"><field name="COMMENT">Turn a new press into one toggle
A rising edge means R3 is down now and was not down in the previous loop. Only that change flips the ON latch. Holding the button leaves the latch unchanged; releasing it prepares the program to notice another press.
For example: With readiness true and no reverse or stop input: press R3 → ON; keep holding → still ON; release → still ON; press again → OFF.
Think first: What happens during ten loops with R3 still held?</field><next><block type="controls_if" id="intake_0036"><mutation elseif="0" else="0"/><value name="IF0"><block type="logic_operation" id="intake_0032"><field name="OP">AND</field><value name="A"><block type="variables_get" id="intake_0029"><field name="VAR" id="intake_var_currentR3">currentR3</field></block></value><value name="B"><block type="logic_negate" id="intake_0031"><value name="BOOL"><block type="variables_get" id="intake_0030"><field name="VAR" id="intake_var_previousR3">previousR3</field></block></value></block></value></block></value><statement name="DO0"><block type="variables_set" id="intake_0035"><field name="VAR" id="intake_var_on">on</field><value name="VALUE"><block type="logic_negate" id="intake_0034"><value name="BOOL"><block type="variables_get" id="intake_0033"><field name="VAR" id="intake_var_on">on</field></block></value></block></value></block></statement><next><block type="controls_if" id="intake_0040"><mutation elseif="0" else="0"/><value name="IF0"><block type="variables_get" id="intake_0037"><field name="VAR" id="intake_var_on">on</field></block></value><statement name="DO0"><block type="variables_set" id="intake_0039"><field name="VAR" id="intake_var_power">power</field><value name="VALUE"><block type="math_number" id="intake_0038"><field name="NUM">0.25</field></block></value></block></statement></block></next></block></next></block></statement><next><block type="variables_set" id="intake_0043"><field name="VAR" id="intake_var_previousR3">previousR3</field><value name="VALUE"><block type="variables_get" id="intake_0042"><field name="VAR" id="intake_var_currentR3">currentR3</field></block></value><next><block type="comment" id="student_intake_power"><field name="COMMENT">Send a command, not a speed promise
After the decisions, set Power sends the chosen value to the motor: +0.25 for ON, −0.25 for held reverse, or zero for OFF. The magnitude 0.25 is a 25% duty-cycle command. It is not a measurement of 25% RPM or 25% torque: battery voltage, friction, and load also affect motion.
For example: Two trials can both request +0.25 while the intake turns at different speeds because one trial has more load.
Think first: If the requested power stays the same, must the observed speed stay the same?</field><next><block type="dcMotor_setProperty_Number" id="intake_0046"><field name="IDENTIFIER">intake_motorAsDcMotor</field><field name="PROP">Power</field><value name="VALUE"><block type="variables_get" id="intake_0045"><field name="VAR" id="intake_var_power">power</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="procedures_defnoreturn" id="intake_0120" x="30" y="2005"><field name="NAME">intakeTelemetry</field><statement name="STACK"><block type="comment" id="student_intake_telemetry"><field name="COMMENT">Read the program's decisions
Telemetry displays power, the ON latch, raw R3, B, Start, and readiness. Read them together to explain a decision. Raw R3 describes the input; ON describes remembered forward selection; power describes the output request. They are not three names for the same thing.
For example: After you release a successful toggle press, raw R3 can be false while ON is true and power is +0.25.
Think first: What should you look at if a paddle stops the intake?</field><next><block type="telemetry_addTextData_All" id="intake_0050"><value name="KEY"><block type="text" id="intake_0049"><field name="TEXT">power</field></block></value><value name="TEXT"><block type="variables_get" id="intake_0048"><field name="VAR" id="intake_var_power">power</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0053"><value name="KEY"><block type="text" id="intake_0052"><field name="TEXT">toggle ON</field></block></value><value name="TEXT"><block type="variables_get" id="intake_0051"><field name="VAR" id="intake_var_on">on</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0056"><value name="KEY"><block type="text" id="intake_0055"><field name="TEXT">raw R3</field></block></value><value name="TEXT"><block type="variables_get" id="intake_0054"><field name="VAR" id="intake_var_currentR3">currentR3</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0059"><value name="KEY"><block type="text" id="intake_0058"><field name="TEXT">B</field></block></value><value name="TEXT"><block type="variables_get" id="intake_0057"><field name="VAR" id="intake_var_stopButton">stopButton</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0062"><value name="KEY"><block type="text" id="intake_0061"><field name="TEXT">Start</field></block></value><value name="TEXT"><block type="variables_get" id="intake_0060"><field name="VAR" id="intake_var_startButton">startButton</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0065"><value name="KEY"><block type="text" id="intake_0064"><field name="TEXT">ready</field></block></value><value name="TEXT"><block type="variables_get" id="intake_0063"><field name="VAR" id="intake_var_ready">ready</field></block></value><next><block type="telemetry_addTextData_All" id="intake_0068"><value name="KEY"><block type="text" id="intake_0067"><field name="TEXT">readiness</field></block></value><value name="TEXT"><block type="misc_callJava_return" id="intake_0066"><mutation methodLookupString="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport intakeStatus() java.lang.String" fullClassName="org.firstinspires.ftc.teamcode.CalibrationBlocksSupport" simpleName="CalibrationBlocksSupport" parameterCount="0" returnType="java.lang.String" color="289" heading="Calibration lesson" comment="" tooltip="" accessMethod="callJava_String" convertReturnValue="" createDropdownFunctionName=""/><field name="CLASS_NAME">CalibrationBlocksSupport</field><field name="METHOD_NAME">intakeStatus</field></block></value><next><block type="telemetry_update" id="intake_0069"/></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>
<Extra>
<OpModeMeta flavor="TELEOP" group="90 Blocks" />
<Enabled value="false" />
</Extra>
