# sliicy/8x8x8-led architecture

> Architecture diagram of the GitHub repository sliicy/8x8x8-led, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sliicy/8x8x8-led
- Repository: https://github.com/sliicy/8x8x8-led

## Overview

##### Project type and purpose
- This is a hardware-integrated desktop application for driving an 8×8×8 LED/RGB cube over USB.
- It consists of:
- A WinForms GUI (8x8x8-LED.WinForm) offering applets (Clock, Pong, Snake, Music Visualizer, etc.).
- Embedded firmware for two microcontroller targets (Monochrome STC12C5A60S2 and RGB GD32F103RETx).
- Mechanical assets (3D-printed parts) and electrical schematics.

##### File structure
- Top-level directories:
- 3D Printed Parts – Blender and STL files for cube base design.
- 8x8x8-LED.Core – Business logic, data models (Cube, Position, Direction), helpers (ColorHelper, SerialHelper).
- 8x8x8-LED.WinForm – Presentation layer with Views for each applet; uses Core library; manages SerialPort.
- Examples – Sample images/videos demonstrating animations.
- Firmware – Embedded code for Monochrome (C with STC) and RGB (Arduino/STM32) microcontrollers, plus build scripts.
- Schematics – PDFs and datasheets describing the electrical design.
- The solution file (8x8x8-LED.sln) ties together the Core and WinForm projects.
- Configuration files: App.config (WinForms), .csproj files, packages.config, build scripts for firmware.

##### Extract insights from README
- Key workflows:
- User runs WinForms EXE → configures COM port & cube type → selects mini-applet → backend Core library assembles frame data → SerialHelper dispatches packets over USB→ microcontroller firmware drives LED matrix.
- Separate flash processes needed for firmware builds (STC ISP tool for monochrome, Arduino IDE + STM32CubeProgrammer for RGB).
- Dependencies: .NET Framework (WinForms), C# libraries, Arduino toolchain, STC flashing tool.
- Hardware & mechanical add-ons: 3D-printed cube base, schematics for assembly.

##### Detail
- Mini-applet as a logical subcomponent under the UI layer.
- Firmware forks (Monochrome vs. RGB) as separate modules with their respective toolchains and protocols (baud rates).
- Don’t omit the 3D-printed base or schematics—they’re part of the system’s deliverables.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers
    subgraph "User Layer"
        U[/"User (PC Operator)"/]:::user
    end

    subgraph "Presentation Layer"
        UI["WinForms UI"]:::frontend
        UI_proj["8x8x8-LED.WinForm.csproj"]:::frontend
        UI_cfg["App.config"]:::frontend
        UI_entry["Program.cs"]:::frontend
        UI_views["Views (Applets & MainMenu)"]:::frontend
    end

    subgraph "Business Logic Layer"
        Core["Core Library"]:::logic
        Core_proj["8x8x8-LED.Core.csproj"]:::logic
        CH["ColorHelper.cs"]:::logic
        SH["SerialHelper.cs"]:::logic
        CubeModel["Cube.cs"]:::logic
        CubeColor["CubeColor.cs"]:::logic
        CubeType["CubeType.cs"]:::logic
        ICube["ICube.cs"]:::logic
        MonoCubeSpec["MonochromeCube.cs"]:::logic
        Geometry["Geometry Models"]:::logic
        PongModels["Pong Models"]:::logic
        SnakeModel["Snake.cs"]:::logic
    end

    subgraph "Hardware Interface Layer"
        SP[/"SerialPort (USB-to-UART)"/]:::hardware
    end

    subgraph "Firmware"
        subgraph MonochromeFirmware
            M_src["8x8x8 Monochrome Cube Firmware.c"]:::hardware
            M_bin[".ihx & .hex"]:::hardware
            M_build["compile.bat"]:::tools
        end
        subgraph RGBFirmware
            R_src["8x8x8_RGB_LED_iCubeSmart.ino"]:::hardware
            R_bin[".bin / .hex"]:::hardware
        end
    end

    subgraph "LED Hardware"
        LED[/8×8×8 LED/RGB Matrix/]:::physical
    end

    subgraph "Physical Assets"
        Parts3D["3D Printed Parts"]:::physical
        Blend["8x8x8 RGB Bottom.blend"]:::physical
        STL["8x8x8 RGB Cube Bottom.stl"]:::physical
        Schematics["Electrical Schematics"]:::physical
        MonoSch["Monochrome Schematic.pdf"]:::physical
        RgbSch["RGB Schematics PDFs"]:::physical
    end

    subgraph "Examples & Media"
        ExamplesDir["Examples (Images & Videos)"]:::physical
        ExamplesReadme["README.md"]:::physical
    end

    Solution["8x8x8-LED.sln"]:::physical

    %% Connections
    U -->|"interacts with"| UI
    UI -->|"invokes"| Core
    Core -->|"writes frames"| SP
    SP -->|"USB data"| MonochromeFirmware & RGBFirmware
    MonochromeFirmware -->|"drives"| LED
    RGBFirmware -->|"drives"| LED

    M_build -->|"flashes firmware"| MonochromeFirmware
    %% Tools for RGB flashing implied Arduino/STM32Cube

    %% Subgraph internal structure
    UI --> UI_proj
    UI --> UI_cfg
    UI --> UI_entry
    UI --> UI_views

    Core --> Core_proj
    Core --> CH
    Core --> SH
    Core --> CubeModel
    Core --> CubeColor
    Core --> CubeType
    Core --> ICube
    Core --> MonoCubeSpec
    Core --> Geometry
    Core --> PongModels
    Core --> SnakeModel

    Parts3D --> Blend
    Parts3D --> STL
    Schematics --> MonoSch
    Schematics --> RgbSch
    ExamplesDir --> ExamplesReadme

    %% Click events
    click UI_proj "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.WinForm/8x8x8-LED.WinForm.csproj"
    click UI_cfg "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.WinForm/App.config"
    click UI_entry "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.WinForm/Program.cs"
    click UI_views "https://github.com/sliicy/8x8x8-led/tree/master/8x8x8-LED.WinForm/Views"
    click Core_proj "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/8x8x8-LED.Core.csproj"
    click CH "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Helpers/ColorHelper.cs"
    click SH "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Helpers/SerialHelper.cs"
    click CubeModel "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Models/Cube.cs"
    click CubeColor "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Models/CubeColor.cs"
    click CubeType "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Models/CubeType.cs"
    click ICube "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Models/ICube.cs"
    click MonoCubeSpec "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Models/MonochromeCube.cs"
    click Geometry "https://github.com/sliicy/8x8x8-led/tree/master/8x8x8-LED.Core/Models/Geometry"
    click PongModels "https://github.com/sliicy/8x8x8-led/tree/master/8x8x8-LED.Core/Models/Pong"
    click SnakeModel "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.Core/Models/Snake/Snake.cs"
    click M_src "https://github.com/sliicy/8x8x8-led/blob/master/Firmware/Monochrome/8x8x8 Monochrome Cube Firmware.c"
    click M_bin "https://github.com/sliicy/8x8x8-led/tree/master/Firmware/Monochrome"
    click M_build "https://github.com/sliicy/8x8x8-led/blob/master/Firmware/Monochrome/compile.bat"
    click R_src "https://github.com/sliicy/8x8x8-led/blob/master/Firmware/RGB/8x8x8_RGB_LED_iCubeSmart/8x8x8_RGB_LED_iCubeSmart.ino"
    click R_bin "https://github.com/sliicy/8x8x8-led/blob/master/Firmware/RGB/8x8x8_RGB_LED_iCubeSmart/8x8x8_RGB_LED_iCubeSmart.ino.GENERIC_F103RETX.bin"
    click Parts3D "https://github.com/sliicy/8x8x8-led/tree/master/3D Printed Parts"
    click Blend "https://github.com/sliicy/8x8x8-led/blob/master/3D Printed Parts/8x8x8 RGB Bottom.blend"
    click STL "https://github.com/sliicy/8x8x8-led/blob/master/3D Printed Parts/8x8x8 RGB Cube Bottom.stl"
    click Schematics "https://github.com/sliicy/8x8x8-led/tree/master/Schematics"
    click MonoSch "https://github.com/sliicy/8x8x8-led/blob/master/Schematics/Monochrome/iCubeSmart Schematic.pdf"
    click RgbSch "https://github.com/sliicy/8x8x8-led/tree/master/Schematics/RGB"
    click ExamplesDir "https://github.com/sliicy/8x8x8-led/tree/master/Examples"
    click ExamplesReadme "https://github.com/sliicy/8x8x8-led/blob/master/Examples/README.md"
    click Solution "https://github.com/sliicy/8x8x8-led/blob/master/8x8x8-LED.sln"

    %% Styles
    classDef frontend fill:#c2f0c2,stroke:#2d572c;
    classDef logic fill:#c2d9f0,stroke:#1d3b5f;
    classDef hardware fill:#f0c2a2,stroke:#5f2d1d;
    classDef physical fill:#e0e0e0,stroke:#888888;
    classDef tools fill:#f0e68c,stroke:#6b5b2b;
    classDef user fill:#fff2cc,stroke:#7f6000;
```
