# eatfears/noritsu-v30 architecture

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

- Interactive diagram: https://gitdiagram.com/eatfears/noritsu-v30
- Repository: https://github.com/eatfears/noritsu-v30

## Overview

This is embedded firmware for a film-processing machine: it senses cover, leader, film, perforation, and drive activity; advances through loading and timed processing states; and controls film-handling elements and replenisher pumps. The stages also classify film width and can simulate leaders. The README is empty, and the main sketch and several listed headers were not sampled, so the graph focuses on relationships directly supported by the available source.

Main entry points: [`stages.h`](https://github.com/eatfears/noritsu-v30/blob/master/stages.h) (Processing stages), [`pin.h`](https://github.com/eatfears/noritsu-v30/blob/master/pin.h) (Pin adapters), [`elements.h`](https://github.com/eatfears/noritsu-v30/blob/master/elements.h) (Machine elements), [`sensors.h`](https://github.com/eatfears/noritsu-v30/blob/master/sensors.h) (Sensor instances)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Processing workflow"]
  node_stages["Processing stages<br/>[stages.h]"]
  node_classification["Film classification<br/>[stages.h]"]
  node_fake["Fake leaders<br/>[fake_leaders.h]"]
end

subgraph group_io["Machine I/O"]
  node_sensors["Sensor instances<br/>[sensors.h]"]
  node_sensor["Sensor abstraction<br/>[pin.h]"]
  node_elements["Machine elements<br/>[elements.h]"]
  node_pin["Pin adapters<br/>[pin.h]"]
end

subgraph group_control["Timing and signals"]
  node_drive["Drive counter<br/>[drive_sensor.h]"]
  node_pumps["Timed pumps<br/>[pump.h]"]
  node_signal["Audible signal<br/>[signal.h]"]
end

subgraph group_platform["Hardware platform"]
  node_arduino["Arduino I/O"]
  node_expander["PCA9555 expander"]
end

node_machine(("Film processor"))
node_sketch["Firmware entry<br/>[Noritsu.ino]"]

node_machine -->|"changes inputs"| node_sensors
node_machine -->|"receives actuation"| node_elements
node_sketch --> node_stages
node_stages -->|"reads sensors"| node_sensors
node_stages -->|"checks counts"| node_drive
node_stages -->|"classifies film"| node_classification
node_stages -->|"starts or stops"| node_fake
node_stages -->|"fires and closes"| node_pumps
node_stages -->|"checks signal"| node_signal
node_fake -->|"changes outputs"| node_elements
node_sensors -->|"instantiates"| node_sensor
node_sensor -->|"reads pin"| node_pin
node_elements -->|"instantiates"| node_pin
node_pumps -->|"sets output"| node_elements
node_pin -->|"uses GPIO"| node_arduino
node_pin -->|"uses I2C"| node_expander
node_drive -->|"attaches interrupt"| node_arduino
node_signal -->|"drives tone"| node_arduino

click node_sketch "https://github.com/eatfears/noritsu-v30/blob/master/Noritsu.ino"
click node_stages "https://github.com/eatfears/noritsu-v30/blob/master/stages.h"
click node_classification "https://github.com/eatfears/noritsu-v30/blob/master/stages.h"
click node_fake "https://github.com/eatfears/noritsu-v30/blob/master/fake_leaders.h"
click node_sensors "https://github.com/eatfears/noritsu-v30/blob/master/sensors.h"
click node_sensor "https://github.com/eatfears/noritsu-v30/blob/master/pin.h"
click node_elements "https://github.com/eatfears/noritsu-v30/blob/master/elements.h"
click node_pin "https://github.com/eatfears/noritsu-v30/blob/master/pin.h"
click node_drive "https://github.com/eatfears/noritsu-v30/blob/master/drive_sensor.h"
click node_pumps "https://github.com/eatfears/noritsu-v30/blob/master/pump.h"
click node_signal "https://github.com/eatfears/noritsu-v30/blob/master/signal.h"

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_stages,node_classification,node_fake toneBlue
class node_sensors,node_sensor,node_elements,node_pin toneAmber
class node_drive,node_pumps,node_signal toneMint
class node_arduino,node_expander toneRose
class node_machine toneIndigo
class node_sketch toneTeal
```

## Components

### Processing workflow

- [Processing stages](https://github.com/eatfears/noritsu-v30/blob/master/stages.h): `stages.h`
- [Film classification](https://github.com/eatfears/noritsu-v30/blob/master/stages.h): `stages.h`
- [Fake leaders](https://github.com/eatfears/noritsu-v30/blob/master/fake_leaders.h): `fake_leaders.h`

### Machine I/O

- [Sensor instances](https://github.com/eatfears/noritsu-v30/blob/master/sensors.h): `sensors.h`
- [Sensor abstraction](https://github.com/eatfears/noritsu-v30/blob/master/pin.h): `pin.h`
- [Machine elements](https://github.com/eatfears/noritsu-v30/blob/master/elements.h): `elements.h`
- [Pin adapters](https://github.com/eatfears/noritsu-v30/blob/master/pin.h): `pin.h`

### Timing and signals

- [Drive counter](https://github.com/eatfears/noritsu-v30/blob/master/drive_sensor.h): `drive_sensor.h`
- [Timed pumps](https://github.com/eatfears/noritsu-v30/blob/master/pump.h): `pump.h`
- [Audible signal](https://github.com/eatfears/noritsu-v30/blob/master/signal.h): `signal.h`

### Hardware platform

- **Arduino I/O**
- **PCA9555 expander**

### Other components

- **Film processor**
- [Firmware entry](https://github.com/eatfears/noritsu-v30/blob/master/Noritsu.ino): `Noritsu.ino`

## Connections

- Film processor → Sensor instances: changes inputs
- Film processor → Machine elements: receives actuation
- Firmware entry → Processing stages
- Processing stages → Sensor instances: reads sensors
- Processing stages → Drive counter: checks counts
- Processing stages → Film classification: classifies film
- Processing stages → Fake leaders: starts or stops
- Processing stages → Timed pumps: fires and closes
- Processing stages → Audible signal: checks signal
- Fake leaders → Machine elements: changes outputs
- Sensor instances → Sensor abstraction: instantiates
- Sensor abstraction → Pin adapters: reads pin
- Machine elements → Pin adapters: instantiates
- Timed pumps → Machine elements: sets output
- Pin adapters → Arduino I/O: uses GPIO
- Pin adapters → PCA9555 expander: uses I2C
- Drive counter → Arduino I/O: attaches interrupt
- Audible signal → Arduino I/O: drives tone
