> For the complete documentation index, see [llms.txt](https://guide.petoi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.petoi.com/product/quaddle-under-construction/control-and-program/touch-buttons.md).

# Touch Buttons

There are 4 touch buttons (**F**, **L**, **R**, and **B**) on the AI ​​core board. **F, L, R,** and **B** refer to the front, left, right, and back regions of the touch panel on the robot's back. All left and right directions in this document are from the robot's perspective.

### Input Rules <a href="#input-rules" id="input-rules"></a>

* A short press is recognized after the button is released.
* Consecutive taps must be no more than approximately **0.55 seconds** apart. After a single or double tap, the system waits briefly to determine whether another tap follows.
* Holding a button for approximately **0.75 seconds** is recognized as a long press. Releasing the button after a long press does not trigger its short-press function.
* A beep sounds whenever a newly touched region is recognized.

### Quick Reference <a href="#quick-reference" id="quick-reference"></a>

| Button        | Single tap                | Double tap                                     | Triple tap            | Long press                               |
| ------------- | ------------------------- | ---------------------------------------------- | --------------------- | ---------------------------------------- |
| **F — Front** | Forward movement sequence | Drag-and-learn                                 | Automatic calibration | Charge sleep mode                        |
| **L — Left**  | Left-turn sequence        | Drag-follow demo                               | Three-legged gait     | Slow crawl 45° left                      |
| **R — Right** | Right-turn sequence       | Replay learned motion                          | Climb a step          | Slow crawl 45° right                     |
| **B — Back**  | Jump-and-slide sequence   | Alternate gestures or switch extension modules | Dance routine         | Scout: butt-up; Buddy: backflip sequence |

### F (Front) <a href="#f-front" id="f-front"></a>

#### Single Tap: Forward Movement Sequence <a href="#single-tap-forward-movement-sequence" id="single-tap-forward-movement-sequence"></a>

The robot walks forward for 5 cycles (`wkF 5`), trots forward for 5 cycles (`trF 5`), and then walks backward for 8 cycles (`wkB 8`).

#### Double Tap: Drag-and-Learn <a href="#double-tap-drag-and-learn" id="double-tap-drag-and-learn"></a>

Enters drag-and-learn mode (`fl`) for recording a motion by manually moving the joints. Recording begins after the robot finishes preparing and plays a prompt tone. While learning, the touch buttons temporarily have different functions:

* Touch **L** to record or confirm the current key pose.
* Touch **R** to finish learning and save the recording.

After recording, the robot returns to its standing posture. Double-tap R to replay the learned motion.

#### Triple Tap: Automatic Calibration <a href="#triple-tap-automatic-calibration" id="triple-tap-automatic-calibration"></a>

Starts automatic calibration for all six joints. When the prompt appears, place the robot firmly and evenly against the floor:

* Touch **F** again to confirm and perform the calibration.
* Touch **L, R, or B** to cancel calibration and restore the previous calibration values.

#### Long Press: Charge Sleep Mode <a href="#long-press-charge-sleep-mode" id="long-press-charge-sleep-mode"></a>

Stops pending actions, puts the robot into its resting posture, disables the servos, and displays the battery/charging screen. To exit this mode, flip the robot over once, send any data over USB or Bluetooth serial, or unplug USB power while charging. The touch buttons cannot wake the robot from charge sleep mode.

### L (Left) <a href="#l-left" id="l-left"></a>

#### Single Tap: Left-Turn Sequence <a href="#single-tap-left-turn-sequence" id="single-tap-left-turn-sequence"></a>

The robot turns 180° to the left in place (`vtL 180`), walks through a 45° left turn (`wkL 45`), trots through another 45° left turn (`trL 45`), moves sideways to the left for 3 seconds (`sideL`), and finally returns to its standing posture (`up`).

#### Double Tap: Drag-Follow Demo <a href="#double-tap-drag-follow-demo" id="double-tap-drag-follow-demo"></a>

Enters joint drag-follow mode (`F`). The servos switch to a state that allows manual movement. When one leg joint is moved, the other leg joints follow it to the same angle. This mode demonstrates synchronized joint following and does not record a motion.

#### Triple Tap: Three-Legged Gait <a href="#triple-tap-three-legged-gait" id="triple-tap-three-legged-gait"></a>

The robot first assumes the preparation pose (`preparationL`) and then walks forward for approximately 5 seconds without using its right rear leg (`noRightBackF 5000`).

#### Long Press: Slow Left Turn <a href="#long-press-slow-left-turn" id="long-press-slow-left-turn"></a>

Performs a slow crawling turn of 45° to the left (`crL 45`).

### R (Right) <a href="#r-right" id="r-right"></a>

#### Single Tap: Right-Turn Sequence <a href="#single-tap-right-turn-sequence" id="single-tap-right-turn-sequence"></a>

The robot turns 180° to the right in place (`vtR 180`), walks through a 45° right turn (`wkR 45`), trots through another 45° right turn (`trR 45`), moves sideways to the right for 3 seconds (`sideR`), and finally returns to its standing posture (`up`).

#### Double Tap: Replay a Learned Motion <a href="#double-tap-replay-a-learned-motion" id="double-tap-replay-a-learned-motion"></a>

Replays the motion most recently recorded by double-tapping F (`fr`) and automatically selects a smooth-merge level. If no learned motion is available in memory during the current power cycle, the robot instead plays the temporary motion stored in persistent storage (`T`).

#### Triple Tap: Climb a Step <a href="#triple-tap-climb-a-step" id="triple-tap-climb-a-step"></a>

Runs the complete step-climbing sequence (`qStep`): `step1F` → `step2F 3` → `step3` → `up`. Use this function only in front of a stable step of a suitable size with a clearly defined edge, and provide enough space to prevent a fall.

#### Long Press: Slow Right Turn <a href="#long-press-slow-right-turn" id="long-press-slow-right-turn"></a>

Performs a slow crawling turn of 45° to the right (`crR 45`).

### B (Back) <a href="#b-back" id="b-back"></a>

#### Single Tap: Jump-and-Slide Sequence <a href="#single-tap-jump-and-slide-sequence" id="single-tap-jump-and-slide-sequence"></a>

The robot performs a jump-slide start (`jumpSlide`), slides for 3 seconds (`slide`), and then bounds forward for 5 cycles (`bdF 5`, bound forward).

#### Double Tap: Alternate Gestures or Switch Extension Modules <a href="#double-tap-alternate-gestures-or-switch-extension-modules" id="double-tap-alternate-gestures-or-switch-extension-modules"></a>

This function depends on whether an APDS9960 gesture sensor is detected at startup:

* **Buddy / no gesture sensor detected:** Alternates between the `hds` and `hi` motions, performing one of them on each double tap.
* **Scout / gesture sensor detected:** Cycles through the active extension module. With the options currently enabled in this project, the sequence is dual light sensors (`XL`) → dual infrared distance sensors (`XD`) → gesture sensor (`XG`) → dual-microphone sound localization (`XM`) → all modules off.

#### Triple Tap: Dance Routine <a href="#triple-tap-dance-routine" id="triple-tap-dance-routine"></a>

Runs the Quaddle dance sequence (`qDance`). The robot enters its dance posture, performs two dance segments, and then returns to its standing posture.

#### Long Press: Model-Dependent Motion <a href="#long-press-model-dependent-motion" id="long-press-model-dependent-motion"></a>

* **Scout / gesture sensor detected:** Performs the butt-up motion (`buttUp`) and then returns to its standing posture (`up`).
* **Buddy / no gesture sensor detected:** Performs a backflip (`bf`) followed by a rolling motion (`flipRoll`).

Backflips and rolls require a large, level, non-slip area. Keep people, pets, and fragile objects away from the robot.

{% hint style="info" %}
**Note:**

* A triple tap must be completed continuously. If two taps are more than approximately 0.55 seconds apart, they are recognized as separate, lower-count tap sequences.
* Make sure there is enough space around the robot before running any motion, especially step climbing, sideways movement, backflips, and rolls.
* Some functions run sequentially in the task queue. If the robot is already executing a sequence, a new touch may first stop the current queue. Touch the desired button again afterward.
* The Scout/Buddy behavior of B double-tap and B long-press is determined by whether the APDS9960 sensor is detected at startup at I²C address `0x39`, not solely by the robot's enclosure or product name.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://guide.petoi.com/product/quaddle-under-construction/control-and-program/touch-buttons.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
