# thirtythreedown/pico_macropad architecture

> Architecture diagram of the GitHub repository thirtythreedown/pico_macropad, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thirtythreedown/pico_macropad
- Repository: https://github.com/thirtythreedown/pico_macropad

## Overview

This repository is a Pi Pico macro pad: its firmware polls physical switches and a rotary encoder, then sends keyboard or consumer-control HID events. The tree also contains four 3D-printable hardware parts. The firmware excerpt supports the input and HID relationships; the README gives no further product detail, and the STL assembly relationships are not documented.

Main entry points: [`Pico macro keyboard code (switches, rotary click, volume control).py`](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py) (Input polling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Pico firmware"]
  node_poller["Input polling"]
  node_switches["Key switches"]
  node_encoder["Rotary encoder"]
  node_key_actions["Keyboard shortcuts"]
  node_volume_actions["Volume and mute"]
  node_hid["USB HID output"]
end

subgraph group_hardware["Printed hardware"]
  node_band["Band model"]
  node_bottom["Case bottom"]
  node_top["Case top"]
  node_plate["Switch plate"]
end

node_operator(("Operator"))
node_computer(("Connected computer"))

node_operator -->|"presses"| node_switches
node_operator -->|"turns or clicks"| node_encoder
node_poller -->|"reads pins"| node_switches
node_poller -->|"reads pins"| node_encoder
node_poller -->|"dispatches"| node_key_actions
node_poller -->|"dispatches"| node_volume_actions
node_key_actions -->|"sends keys"| node_hid
node_volume_actions -->|"sends controls"| node_hid
node_hid -->|"sends HID events"| node_computer

click node_poller "https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py"
click node_switches "https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py"
click node_encoder "https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py"
click node_key_actions "https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py"
click node_volume_actions "https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py"
click node_hid "https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py"
click node_band "https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_band.stl"
click node_bottom "https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_case_bottom.stl"
click node_top "https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_case_top.stl"
click node_plate "https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_switch_plate.stl"

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_poller,node_switches,node_encoder,node_key_actions,node_volume_actions,node_hid toneBlue
class node_band,node_bottom,node_top,node_plate toneAmber
class node_operator,node_computer toneIndigo
```

## Components

### Pico firmware

- [Input polling](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py): `Pico macro keyboard code (switches, rotary click, volume control).py`
- [Key switches](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py): `Pico macro keyboard code (switches, rotary click, volume control).py`
- [Rotary encoder](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py): `Pico macro keyboard code (switches, rotary click, volume control).py`
- [Keyboard shortcuts](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py): `Pico macro keyboard code (switches, rotary click, volume control).py`
- [Volume and mute](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py): `Pico macro keyboard code (switches, rotary click, volume control).py`
- [USB HID output](https://github.com/thirtythreedown/pico_macropad/blob/main/Pico%20macro%20keyboard%20code%20(switches%2C%20rotary%20click%2C%20volume%20control).py): `Pico macro keyboard code (switches, rotary click, volume control).py`

### Printed hardware

- [Band model](https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_band.stl): `pico_macropad_band.stl`
- [Case bottom](https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_case_bottom.stl): `pico_macropad_case_bottom.stl`
- [Case top](https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_case_top.stl): `pico_macropad_case_top.stl`
- [Switch plate](https://github.com/thirtythreedown/pico_macropad/blob/main/pico_macropad_switch_plate.stl): `pico_macropad_switch_plate.stl`

### Other components

- **Operator**
- **Connected computer**

## Connections

- Operator → Key switches: presses (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Operator → Rotary encoder: turns or clicks (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Input polling → Key switches: reads pins (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Input polling → Rotary encoder: reads pins (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Input polling → Keyboard shortcuts: dispatches (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Input polling → Volume and mute: dispatches (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Keyboard shortcuts → USB HID output: sends keys (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- Volume and mute → USB HID output: sends controls (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
- USB HID output → Connected computer: sends HID events (evidence: `Pico macro keyboard code (switches, rotary click, volume control).py`)
