# jmeyerson99/ide-lab architecture

> Architecture diagram of the GitHub repository jmeyerson99/ide-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jmeyerson99/ide-lab
- Repository: https://github.com/jmeyerson99/ide-lab

## Overview

This repository’s primary runtime is an embedded NXP Cup car controller: the operator selects a speed mode, the controller captures a camera line, derives a track midpoint, and adjusts steering and motor commands. The camera capture and vehicle control are implemented in the same camera and main modules, respectively; PWM, switches, LEDs, and UART provide supporting hardware interfaces. The tree also contains standalone lab programs and an older camera implementation, shown separately as experiments rather than part of the active control path. Relationships are limited to calls visible in the supplied excerpts or references in the SOURCE INDEX.

Main entry points: [`code/main.c`](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/main.c) (Car controller), [`code/pwm.c`](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/pwm.c) (PWM control), [`code/uart.c`](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/uart.c) (UART interface), [`code/camera.c`](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/camera.c) (Camera capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Vehicle control"]
  node_controller["Car controller<br/>[main.c]"]
end

subgraph group_sensing["Line sensing"]
  node_line_capture["Camera capture<br/>[camera.c]"]
end

subgraph group_hardware["Hardware interfaces"]
  node_switches["Mode switches<br/>[switch.c]"]
  node_indicators["LED indicators<br/>[led.c]"]
  node_pwm["PWM control<br/>[pwm.c]"]
  node_serial["UART interface<br/>[uart.c]"]
end

subgraph group_experiments["Lab experiments"]
  node_legacy_camera["Legacy camera app<br/>[camera_main.c]"]
  node_adc_lab["ADC lab app<br/>[adc_main.c]"]
  node_interrupt_lab["Interrupt lab app<br/>[interrupts_main.c]"]
  node_car_lab["PWM car lab<br/>[car_main.c]"]
  node_motor_lab["Motor lab app<br/>[motors_main.c]"]
end

node_operator(("Operator"))
node_camera_sensor["Line-scan camera"]
node_vehicle["Motors and servo"]

node_operator -->|"selects mode"| node_controller
node_camera_sensor -->|"provides pixels"| node_line_capture
node_controller -->|"gets line"| node_line_capture
node_controller -->|"reads switches"| node_switches
node_controller -->|"controls LEDs"| node_indicators
node_controller -->|"sets drive outputs"| node_pwm
node_pwm -.->|"drives motors"| node_vehicle
node_controller -->|"reads calibration"| node_serial
node_legacy_camera -->|"streams data"| node_serial
node_adc_lab -->|"prints readings"| node_serial
node_interrupt_lab -->|"initializes UART"| node_serial
node_car_lab -->|"tests PWM"| node_pwm
node_motor_lab -->|"tests motors"| node_pwm

click node_controller "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/main.c"
click node_line_capture "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/camera.c"
click node_switches "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/switch.c"
click node_indicators "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/led.c"
click node_pwm "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/pwm.c"
click node_serial "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/uart.c"
click node_legacy_camera "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/camera_main.c"
click node_adc_lab "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/adc_main.c"
click node_interrupt_lab "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/interrupts_main.c"
click node_car_lab "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/car_main.c"
click node_motor_lab "https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/motors_main.c"

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_controller toneBlue
class node_line_capture toneAmber
class node_switches,node_indicators,node_pwm,node_serial toneMint
class node_legacy_camera,node_adc_lab,node_interrupt_lab,node_car_lab,node_motor_lab toneRose
class node_operator,node_camera_sensor,node_vehicle toneIndigo
```

## Components

### Vehicle control

- [Car controller](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/main.c): `code/main.c`

### Line sensing

- [Camera capture](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/camera.c): `code/camera.c`

### Hardware interfaces

- [Mode switches](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/switch.c): `code/switch.c`
- [LED indicators](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/led.c): `code/led.c`
- [PWM control](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/pwm.c): `code/pwm.c`
- [UART interface](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/uart.c): `code/uart.c`

### Lab experiments

- [Legacy camera app](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/camera_main.c): `code/old_mains/camera_main.c`
- [ADC lab app](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/adc_main.c): `code/old_mains/adc_main.c`
- [Interrupt lab app](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/interrupts_main.c): `code/old_mains/interrupts_main.c`
- [PWM car lab](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/car_main.c): `code/old_mains/car_main.c`
- [Motor lab app](https://github.com/jmeyerson99/ide-lab/blob/nxp-cup/code/old_mains/motors_main.c): `code/old_mains/motors_main.c`

### Other components

- **Operator**
- **Line-scan camera**
- **Motors and servo**

## Connections

- Operator → Car controller: selects mode (evidence: `code/main.c`)
- Line-scan camera → Camera capture: provides pixels (evidence: `code/camera.c`)
- Car controller → Camera capture: gets line (evidence: `code/main.c`)
- Car controller → Mode switches: reads switches (evidence: `code/main.c`)
- Car controller → LED indicators: controls LEDs (evidence: `code/main.c`)
- Car controller → PWM control: sets drive outputs (evidence: `code/main.c`)
- PWM control → Motors and servo: drives motors
- Car controller → UART interface: reads calibration (evidence: `code/main.c`)
- Legacy camera app → UART interface: streams data (evidence: `code/old_mains/camera_main.c`)
- ADC lab app → UART interface: prints readings (evidence: `code/old_mains/adc_main.c`)
- Interrupt lab app → UART interface: initializes UART (evidence: `code/old_mains/interrupts_main.c`)
- PWM car lab → PWM control: tests PWM (evidence: `code/old_mains/car_main.c`)
- Motor lab app → PWM control: tests motors (evidence: `code/old_mains/motors_main.c`)
