# adafruit/adafruit_nau7802 architecture

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

- Interactive diagram: https://gitdiagram.com/adafruit/adafruit_nau7802
- Repository: https://github.com/adafruit/adafruit_nau7802

## Overview

##### Project type and purpose
- This is an Arduino “driver” library for the NAU7802 I2C-based 24-bit ADC sensor.
- Its purpose is to provide a hardware-abstraction layer (HAL) and easy-to-use C++ APIs so that any Arduino sketch can communicate with the Adafruit NAU7802 breakout via I2C.

##### File structure
- Top-level source files:
- Adafruit_NAU7802.h / .cpp – the core C++ driver
- library.properties – metadata for the Arduino Library Manager
- examples/nau7802_test.ino – a sample sketch demonstrating usage
- Configuration & CI:
- .github/workflows/githubci.yml – GitHub Actions for building/testing on different Arduino cores
- .gitignore, code-of-conduct.md, license.txt, README.md
- Assets: board image under assets/ used in the README.

##### README for additional insights
- Describes the hardware (Adafruit breakout #4538), communication protocol (I2C), and installation via Arduino Library Manager.

##### Elements
- Software-layers (rectangles in blue)
- Hardware components (rectangles in green)
- CI/docs (rectangles in gray)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development & CI
    subgraph "Development & CI"
        CI["GitHub Actions Workflow"]:::ci
        GitIgnore[".gitignore"]:::ci
        Metadata["library.properties"]:::ci
        Asset["Assets (Board Images)"]:::ci
        subgraph "Documentation & Policies"
            README["README.md"]:::ci
            License["license.txt"]:::ci
            CoC["code-of-conduct.md"]:::ci
        end
        subgraph "Issue & PR Templates"
            Issue[".github/ISSUE_TEMPLATE.md"]:::ci
            PR[".github/PULL_REQUEST_TEMPLATE.md"]:::ci
        end
    end

    %% Software Layer
    subgraph "Software Layer"
        Sketch["User Sketch\n(nau7802_test.ino)"]:::software
        Driver["Adafruit_NAU7802 Driver\n(.h/.cpp)"]:::software
        Wire["Arduino Wire Library\n(I2C)"]:::software
    end

    %% Hardware Layer
    subgraph "Hardware Layer"
        MCU["Microcontroller\n(I2C Master)"]:::hardware
        Sensor["NAU7802 ADC Sensor\n(I2C Slave)"]:::hardware
    end

    %% Interactions
    Sketch -->|"calls API"| Driver
    Driver -->|"uses I2C"| Wire
    Wire -->|"I2C signals"| Sensor
    Sensor -->|"raw data"| Driver
    Driver -->|"returns value"| Sketch
    MCU -->|"I2C Master"| Wire
    MCU <-->|"I2C bus"| Sensor

    %% Click Events
    click CI "https://github.com/adafruit/adafruit_nau7802/blob/master/.github/workflows/githubci.yml"
    click GitIgnore "https://github.com/adafruit/adafruit_nau7802/blob/master/.gitignore"
    click Metadata "https://github.com/adafruit/adafruit_nau7802/blob/master/library.properties"
    click Asset "https://github.com/adafruit/adafruit_nau7802/tree/master/assets/"
    click README "https://github.com/adafruit/adafruit_nau7802/blob/master/README.md"
    click License "https://github.com/adafruit/adafruit_nau7802/blob/master/license.txt"
    click CoC "https://github.com/adafruit/adafruit_nau7802/blob/master/code-of-conduct.md"
    click Issue "https://github.com/adafruit/adafruit_nau7802/blob/master/.github/ISSUE_TEMPLATE.md"
    click PR "https://github.com/adafruit/adafruit_nau7802/blob/master/.github/PULL_REQUEST_TEMPLATE.md"
    click Sketch "https://github.com/adafruit/adafruit_nau7802/blob/master/examples/nau7802_test/nau7802_test.ino"
    click Driver "https://github.com/adafruit/adafruit_nau7802/blob/master/Adafruit_NAU7802.h"

    %% Styles
    classDef software fill:#E0F7FA,stroke:#0077C2,color:#000
    classDef hardware fill:#E8F5E9,stroke:#2E7D32,color:#000
    classDef ci fill:#F5F5F5,stroke:#616161,color:#000
```
