# dhlee-gif/running architecture

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

- Interactive diagram: https://gitdiagram.com/dhlee-gif/running
- Repository: https://github.com/dhlee-gif/running

## Overview

This repository supports an IMU step-counting workflow: firmware supplies serial data, a Python logger records it as CSV, and a command-line analysis script detects steps, estimates cadence, cross-checks with gyroscope swings, and saves a plot. The firmware and plotting-script excerpts are empty, so their internal behavior and the firmware-to-logger connection cannot be verified; that connection is shown as unverified. The README provides no additional capability documentation.

Main entry points: [`tools/imu_logger.py`](https://github.com/dhlee-gif/running/blob/main/tools/imu_logger.py) (Serial logger), [`tools/step_detect.py`](https://github.com/dhlee-gif/running/blob/main/tools/step_detect.py) (Step detector), [`data/walk01.csv`](https://github.com/dhlee-gif/running/blob/main/data/walk01.csv) (IMU CSV), [`firmware/firmware.ino`](https://github.com/dhlee-gif/running/blob/main/firmware/firmware.ino) (IMU firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Data capture"]
  node_firmware["IMU firmware<br/>[firmware.ino]"]
  node_logger["Serial logger<br/>[imu_logger.py]"]
  node_csv["IMU CSV<br/>[walk01.csv]"]
end

subgraph group_analysis["Step analysis"]
  node_detector["Step detector<br/>[step_detect.py]"]
  node_plotter["IMU plot script<br/>[imu_plot.py]"]
  node_results["Counts and plot<br/>[step_detect.py]"]
end

node_user(("Operator"))

node_user -->|"runs logger"| node_logger
node_firmware -.->|"streams samples"| node_logger
node_logger -->|"writes rows"| node_csv
node_user -->|"runs analysis"| node_detector
node_csv -->|"reads samples"| node_detector
node_detector -->|"reports and saves"| node_results

click node_firmware "https://github.com/dhlee-gif/running/blob/main/firmware/firmware.ino"
click node_logger "https://github.com/dhlee-gif/running/blob/main/tools/imu_logger.py"
click node_csv "https://github.com/dhlee-gif/running/blob/main/data/walk01.csv"
click node_detector "https://github.com/dhlee-gif/running/blob/main/tools/step_detect.py"
click node_plotter "https://github.com/dhlee-gif/running/blob/main/tools/imu_plot.py"
click node_results "https://github.com/dhlee-gif/running/blob/main/tools/step_detect.py"

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_firmware,node_logger,node_csv toneBlue
class node_detector,node_plotter,node_results toneAmber
class node_user toneIndigo
```

## Components

### Data capture

- [IMU firmware](https://github.com/dhlee-gif/running/blob/main/firmware/firmware.ino): `firmware/firmware.ino`
- [Serial logger](https://github.com/dhlee-gif/running/blob/main/tools/imu_logger.py): `tools/imu_logger.py`
- [IMU CSV](https://github.com/dhlee-gif/running/blob/main/data/walk01.csv): `data/walk01.csv`

### Step analysis

- [Step detector](https://github.com/dhlee-gif/running/blob/main/tools/step_detect.py): `tools/step_detect.py`
- [IMU plot script](https://github.com/dhlee-gif/running/blob/main/tools/imu_plot.py): `tools/imu_plot.py`
- [Counts and plot](https://github.com/dhlee-gif/running/blob/main/tools/step_detect.py): `tools/step_detect.py`

### Other components

- **Operator**

## Connections

- Operator → Serial logger: runs logger (evidence: `tools/imu_logger.py`)
- IMU firmware → Serial logger: streams samples
- Serial logger → IMU CSV: writes rows (evidence: `tools/imu_logger.py`)
- Operator → Step detector: runs analysis (evidence: `tools/step_detect.py`)
- IMU CSV → Step detector: reads samples (evidence: `tools/step_detect.py`)
- Step detector → Counts and plot: reports and saves (evidence: `tools/step_detect.py`)
