# Programming - Intake and Claw Toggle

## Intake Control

<figure><img src="/files/703MgOCUKdKlN9hXARgw" alt=""><figcaption></figcaption></figure>

When one of the triggers on the gamepad is pressed, it activates our GAMEPAD\_INTAKE function. This simple if/then statement just checks which trigger is being pressed so our servo knows which way to rotate.&#x20;

Because our servo is set to [continuous mode](/rev-crossover-products/servo/srs-programmer/switching-operating-modes.md#continuous-rotation) in our configuration, we have the ability to tell our servo to set a power instead of moving by position increments!&#x20;

<figure><img src="/files/HZBvO2oTGSIlwv2XIV3o" alt=""><figcaption></figcaption></figure>

## Claw Toggle Control

<figure><img src="/files/G0mpFGIslzIRMIttJ2Ec" alt=""><figcaption></figcaption></figure>

When the right bumper is pressed on the gamepad, the claw on the robot either opens or closed. This prevents the driver from having to hold down the button to maintain control of a picked up specimen!&#x20;

Because togglable control is not natively available in the FTC SDK, we have to make use of a couple of variables to help the robot check the state of the claw's servo and the right bumper.&#x20;

<figure><img src="/files/6Ffm90LYtVL6c2KOpCim" alt=""><figcaption></figcaption></figure>

Similar to what's used in our arm control's presets, lastBump checks if the right bumper is being held down and won't accept another input until its been released.&#x20;

<figure><img src="/files/iVdB9CimSv23MV3DXBo8" alt=""><figcaption></figcaption></figure>

Meanwhile, clawOpen allows the servo to shift between the two set positions based on where it has last moved to. You can adjust these values based on your specific robot to have the claw open more or less.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.revrobotics.com/ftc-kickoff-concepts/into-the-deep-2024-25/programming-teleop/programming-intake-and-claw-toggle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
