# mauricechocoswiss/fcuwolverine architecture

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

- Interactive diagram: https://gitdiagram.com/mauricechocoswiss/fcuwolverine
- Repository: https://github.com/mauricechocoswiss/fcuwolverine

## Overview

##### Main Components

- Arduino Nano (Central Controller)
- LCD Display (I2C interface)
- LiPo 2S Battery
- Selector Switch
- Magazine Switch
- Charging Handle Switch
- Solenoid Control
- LED Indicators
- Buzzer

- Main Control Loop (FCU-Wolverine.ino)
- Voltage Control System (VoltageCtrl)
- Firing Control System (Firing)
- Menu System (Menu)
- Alarm System (Alarm)
- Delay Timer (DelayTimer)

##### Component Relationships

**[Power System] → [Arduino Nano (Core Controller)] → [Output Systems]**
- ↑                     ↕                            ↓
**[Input Systems]      [Software Modules]            [Feedback Systems]**

##### Detailed Component Breakdown

A. Input Systems (Left side):
- Battery Input (2S LiPo)
- Selector Switch (4 modes)
- Magazine Switch
- Charging Handle

B. Core Controller (Center):
- Arduino Nano
- Software Modules

C. Output Systems (Right side):
- Solenoid Control
- LCD Display
- LED Indicators
- Buzzer

##### Software Module Interactions

How the software components interact:
**[Main Loop] ←→ [Menu System]**
- ↕            ↕
**[Voltage Control] [Firing Control]**
- ↕            ↕
**[Alarm System] ←→ [Delay Timer]**

##### Operating Modes
A separate section showing the four main operating modes:
- Semi Auto
- Burst
- Full Auto
- Sniper Mode

##### Key Features to Highlight
- Battery voltage monitoring and protection
- Magazine BB counting system
- Rate of fire control
- Multiple safety systems
- User interface and menu system

##### Additional Elements
- Notes for critical voltage and timing parameters
- Menu hierarchy structure
- Safety interlock relationships

Remember to include version information and any critical parameters like voltage thresholds or timing constraints that are essential for system operation.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef power fill:#ff6b6b,stroke:#333,stroke-width:2px
    classDef control fill:#4ecdc4,stroke:#333,stroke-width:2px
    classDef input fill:#95d195,stroke:#333,stroke-width:2px
    classDef output fill:#ffd93d,stroke:#333,stroke-width:2px
    classDef software fill:#a78bfa,stroke:#333,stroke-width:2px
    classDef hardware fill:#e2e8f0,stroke:#333,stroke-width:2px

    %% Hardware Components
    Battery["LiPo 2S Battery"]:::power
    Arduino["Arduino Nano"]:::control
    click Arduino "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/Gerber_PCB V3.zip"
    
    %% Input Devices
    subgraph Inputs
        SelectorSwitch["Selector Switch"]:::input
        MagSwitch["Magazine Switch"]:::input
        ChargingHandle["Charging Handle Switch"]:::input
    end

    %% Software Modules
    subgraph Software
        MainLoop["Main Control Loop"]:::software
        click MainLoop "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/FCU-Wolverine/FCU-Wolverine.ino"
        VoltageCtrl["Voltage Control System"]:::software
        click VoltageCtrl "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/FCU-Wolverine/VoltageCtrl.h"
        FiringCtrl["Firing Control System"]:::software
        click FiringCtrl "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/FCU-Wolverine/Firing.h"
        MenuSystem["Menu System"]:::software
        click MenuSystem "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/FCU-Wolverine/Menu.h"
        AlarmSystem["Alarm System"]:::software
        click AlarmSystem "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/FCU-Wolverine/Alarm.h"
        DelayTimer["Delay Timer"]:::software
        click DelayTimer "https://github.com/MauriceChocoSwiss/FCUWOLVERINE/blob/master/FCU-Wolverine/DelayTimer.h"
    end

    %% Output Devices
    subgraph Outputs
        LCD["LCD Display"]:::output
        LED["LED Indicators"]:::output
        Buzzer["Buzzer"]:::output
        Solenoid["Solenoid Control"]:::output
    end

    %% Operating Modes
    subgraph Modes
        Semi["Semi Auto"]
        Burst["Burst"]
        Auto["Full Auto"]
        Sniper["Sniper Mode"]
    end

    %% Relationships
    Battery --> Arduino
    SelectorSwitch --> Arduino
    MagSwitch --> Arduino
    ChargingHandle --> Arduino

    Arduino --> MainLoop
    MainLoop --> MenuSystem
    MainLoop --> VoltageCtrl
    MainLoop --> FiringCtrl
    MainLoop --> AlarmSystem
    MainLoop --> DelayTimer

    VoltageCtrl --> AlarmSystem
    FiringCtrl --> DelayTimer
    MenuSystem --> LCD
    AlarmSystem --> Buzzer
    AlarmSystem --> LED
    FiringCtrl --> Solenoid

    FiringCtrl --> Semi
    FiringCtrl --> Burst
    FiringCtrl --> Auto
    FiringCtrl --> Sniper

    %% Legend
    subgraph Legend
        Power["Power Components"]:::power
        Control["Control Components"]:::control
        InputDev["Input Devices"]:::input
        OutputDev["Output Devices"]:::output
        SoftwareComp["Software Components"]:::software
    end
```
