# howellwang04/grad-app-project-fireflies architecture

> Architecture diagram of the GitHub repository howellwang04/grad-app-project-fireflies, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/howellwang04/grad-app-project-fireflies
- Repository: https://github.com/howellwang04/grad-app-project-fireflies

## Overview

Project Fireflies combines embedded firefly/swarm firmware with a Unity control project; the documentation tree also indicates network setup and radar-sensor materials. The supplied source excerpts establish the swarm-to-firefly calls, but do not show the firmware entry point, Unity message handling, or hardware wiring, so those connections are omitted rather than inferred.

Main entry points: [`firmware/fireflies_main/FireflySwarm.cpp`](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/FireflySwarm.cpp) (Swarm state and sync), [`firmware/fireflies_main/Firefly.cpp`](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/Firefly.cpp) (Firefly motion and blink)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Firmware simulation"]
  node_firmware_entry["Firmware entry<br/>[fireflies_main.ino]"]
  node_swarm["Swarm state and sync<br/>[FireflySwarm.cpp]"]
  node_firefly["Firefly motion and blink<br/>[Firefly.cpp]"]
  node_swarm_config["Swarm configuration<br/>[FireflySwarm.h]"]
  node_firefly_config["Firefly configuration<br/>[Firefly.h]"]
end

subgraph group_unity["Unity control"]
  node_unity_ui["Swarm UI"]
  node_udp_receiver["ESP32 UDP receiver"]
  node_scene["Communication scene"]
end

subgraph group_hardware["Devices and network"]
  node_esp32["ESP32 device"]
  node_leds["LED array"]
  node_radar["LD2410B radar"]
  node_network["Network setup<br/>[network_setup.md]"]
end

node_operator(("Operator"))

node_swarm -->|"updates flies"| node_firefly

click node_unity_ui "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/unity/FirefliesControl/Assets/Scripts/SwarmSyncControlUI.cs"
click node_udp_receiver "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/unity/FirefliesControl/Assets/Scripts/Esp32UdpReceiver.cs"
click node_scene "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/unity/FirefliesControl/Assets/Scenes/Communication.unity"
click node_firmware_entry "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/fireflies_main.ino"
click node_swarm "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/FireflySwarm.cpp"
click node_firefly "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/Firefly.cpp"
click node_swarm_config "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/FireflySwarm.h"
click node_firefly_config "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/Firefly.h"
click node_network "https://github.com/howellwang04/grad-app-project-fireflies/blob/main/docs/en/network_setup.md"

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_entry,node_swarm,node_firefly,node_swarm_config,node_firefly_config toneBlue
class node_unity_ui,node_udp_receiver,node_scene toneAmber
class node_esp32,node_leds,node_radar,node_network toneMint
class node_operator toneIndigo
```

## Components

### Firmware simulation

- [Firmware entry](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/fireflies_main.ino): `firmware/fireflies_main/fireflies_main.ino`
- [Swarm state and sync](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/FireflySwarm.cpp): `firmware/fireflies_main/FireflySwarm.cpp`
- [Firefly motion and blink](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/Firefly.cpp): `firmware/fireflies_main/Firefly.cpp`
- [Swarm configuration](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/FireflySwarm.h): `firmware/fireflies_main/FireflySwarm.h`
- [Firefly configuration](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/firmware/fireflies_main/Firefly.h): `firmware/fireflies_main/Firefly.h`

### Unity control

- [Swarm UI](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/unity/FirefliesControl/Assets/Scripts/SwarmSyncControlUI.cs): `unity/FirefliesControl/Assets/Scripts/SwarmSyncControlUI.cs`
- [ESP32 UDP receiver](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/unity/FirefliesControl/Assets/Scripts/Esp32UdpReceiver.cs): `unity/FirefliesControl/Assets/Scripts/Esp32UdpReceiver.cs`
- [Communication scene](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/unity/FirefliesControl/Assets/Scenes/Communication.unity): `unity/FirefliesControl/Assets/Scenes/Communication.unity`

### Devices and network

- **ESP32 device**
- **LED array**
- **LD2410B radar**
- [Network setup](https://github.com/howellwang04/grad-app-project-fireflies/blob/main/docs/en/network_setup.md): `docs/en/network_setup.md`

### Other components

- **Operator**

## Connections

- Swarm state and sync → Firefly motion and blink: updates flies
