# corecometindustries/comet-air-mouse architecture

> Architecture diagram of the GitHub repository corecometindustries/comet-air-mouse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/corecometindustries/comet-air-mouse
- Repository: https://github.com/corecometindustries/comet-air-mouse

## Overview

COMET AIR MOUSE is ESP32-C3 firmware that turns motion and button input into a BLE HID mouse. The documented workflow is: boot-time gyro calibration, filtered motion tracking and button gestures, then BLE mouse actions for a paired host. The README documents these capabilities but no source excerpts were provided, so internal handoffs are shown as unverified rather than inferred as confirmed calls.

Main entry points: [`src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino`](https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino) (BLE HID mouse)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Physical Inputs"]
  node_mpu6050["MPU6050"]
  node_buttons["Left/right buttons"]
end

subgraph group_processing["Input Processing"]
  node_calibration["Gyro calibration"]
  node_motion["Motion filtering"]
  node_gestures["Click/scroll gestures"]
end

subgraph group_output["BLE Mouse Output"]
  node_ble["BLE HID mouse"]
end

node_user(("User"))
node_host(("Paired host"))

node_user -->|"moves device"| node_mpu6050
node_mpu6050 -.->|"calibrates at boot"| node_calibration
node_mpu6050 -.->|"tracks motion"| node_motion
node_calibration -.->|"offsets motion"| node_motion
node_motion -.->|"sends cursor movement"| node_ble
node_user -->|"presses"| node_buttons
node_buttons -.->|"detects press duration"| node_gestures
node_gestures -.->|"sends clicks/scrolls"| node_ble
node_host -->|"pairs"| node_ble
node_ble -->|"emits HID actions"| node_host

click node_calibration "https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino"
click node_motion "https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino"
click node_gestures "https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino"
click node_ble "https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mpu6050,node_buttons,node_user toneBlue
class node_calibration,node_motion,node_gestures toneAmber
class node_ble toneMint
class node_host toneIndigo
```

## Components

### Physical Inputs

- **MPU6050**
- **Left/right buttons**

### Input Processing

- [Gyro calibration](https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino): `src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino`
- [Motion filtering](https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino): `src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino`
- [Click/scroll gestures](https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino): `src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino`

### BLE Mouse Output

- [BLE HID mouse](https://github.com/corecometindustries/comet-air-mouse/blob/main/src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino): `src/ESP32-C3-AIR-MOUSE/ESP32-C3-AIR-MOUSE.ino`

### Other components

- **User**
- **Paired host**

## Connections

- User → MPU6050: moves device (evidence: `README.md`)
- MPU6050 → Gyro calibration: calibrates at boot (evidence: `README.md`)
- MPU6050 → Motion filtering: tracks motion (evidence: `README.md`)
- Gyro calibration → Motion filtering: offsets motion
- Motion filtering → BLE HID mouse: sends cursor movement (evidence: `README.md`)
- User → Left/right buttons: presses (evidence: `README.md`)
- Left/right buttons → Click/scroll gestures: detects press duration (evidence: `README.md`)
- Click/scroll gestures → BLE HID mouse: sends clicks/scrolls (evidence: `README.md`)
- Paired host → BLE HID mouse: pairs (evidence: `README.md`)
- BLE HID mouse → Paired host: emits HID actions (evidence: `README.md`)
