# ibn-e-shahid/24-ntu-cs-fl-1010 architecture

> Architecture diagram of the GitHub repository ibn-e-shahid/24-ntu-cs-fl-1010, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ibn-e-shahid/24-ntu-cs-fl-1010
- Repository: https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010

## Overview

This repository is a collection of independent ESP32/Arduino coursework sketches, not one integrated application. Each sketch runs its own setup/loop workflow to read a control or sensor input, generate a timed signal, or report output through serial and/or an OLED. The graph groups the examples by their demonstrated behavior; wiring details and peripheral implementations not shown in excerpts are omitted.

Main entry points: [`homework-01/main.cpp`](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-01/main.cpp) (Button counter), [`week 5/main.cpp`](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%205/main.cpp) (Environment monitor), [`week 7/main.cpp`](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%207/main.cpp) (LDR monitor), [`homework-2/main.cpp`](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-2/main.cpp) (Dual PWM monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_button_counter["Button counter<br/>[main.cpp]"]
  node_counter_oled["Counter OLED<br/>[main.cpp]"]
  node_oled_demo["OLED setup demo<br/>[main.cpp]"]
end

subgraph group_sensing["Sensor monitoring"]
  node_dht_sensor{{"DHT11 sensor"}}
  node_environment_monitor["Environment monitor<br/>[main.cpp]"]
  node_ldr_sensor{{"Light sensor"}}
  node_ldr_monitor["LDR monitor<br/>[main.cpp]"]
  node_oled_display["OLED display"]
end

subgraph group_signals["Signal output"]
  node_dual_pwm["Dual PWM monitor<br/>[main.cpp]"]
  node_dual_leds["PWM LEDs"]
  node_dac_pwm_test["DAC/PWM test<br/>[main.cpp]"]
  node_dac_pwm_outputs["DAC and PWM outputs"]
  node_pwm_fade["PWM LED fade<br/>[main.cpp]"]
  node_fade_led["Fade LED"]
  node_buzzer_tones["Buzzer tones<br/>[main.cpp]"]
  node_buzzer["Buzzer"]
  node_dac_test["DAC LED test<br/>[main.cpp]"]
  node_dac_led["DAC LED output"]
  node_blinking_led["Blinking LED sketch<br/>[main.cpp]"]
  node_blink_led["LED output"]
end

subgraph group_timing["Interrupt examples"]
  node_button_interrupt["Button interrupt<br/>[main.cpp]"]
  node_interrupt_led["Interrupt LED"]
  node_timer_interrupt["Timer interrupt<br/>[main.cpp]"]
  node_timer_led["Timer LED"]
end

node_user(("Button user"))

node_user -->|"presses"| node_button_counter
node_button_counter -->|"updates"| node_counter_oled
node_button_counter -->|"reports count"| node_user
node_environment_monitor -->|"reads"| node_dht_sensor
node_environment_monitor -->|"renders readings"| node_oled_display
node_ldr_monitor -->|"samples"| node_ldr_sensor
node_ldr_monitor -->|"renders values"| node_oled_display
node_dual_pwm -->|"drives brightness"| node_dual_leds
node_dual_pwm -->|"renders status"| node_oled_display
node_dac_pwm_test -->|"writes values"| node_dac_pwm_outputs
node_pwm_fade -->|"fades brightness"| node_fade_led
node_buzzer_tones -->|"sets tones"| node_buzzer
node_dac_test -->|"writes levels"| node_dac_led
node_blinking_led -->|"toggles output"| node_blink_led
node_button_interrupt -->|"toggles on press"| node_interrupt_led
node_timer_interrupt -->|"toggles each second"| node_timer_led

click node_button_counter "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-01/main.cpp"
click node_counter_oled "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-01/main.cpp"
click node_oled_demo "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week4%20part2/main.cpp"
click node_environment_monitor "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%205/main.cpp"
click node_ldr_monitor "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%207/main.cpp"
click node_dual_pwm "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-2/main.cpp"
click node_dac_pwm_test "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/main.cpp"
click node_pwm_fade "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%206/main.cpp"
click node_buzzer_tones "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%206%20part%202/main.cpp"
click node_dac_test "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%208/main.cpp"
click node_blinking_led "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week2/main.cpp"
click node_button_interrupt "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%203/main.cpp"
click node_timer_interrupt "https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%204/main.cpp"

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_button_counter,node_counter_oled,node_oled_demo,node_user toneBlue
class node_dht_sensor,node_environment_monitor,node_ldr_sensor,node_ldr_monitor,node_oled_display toneAmber
class node_dual_pwm,node_dual_leds,node_dac_pwm_test,node_dac_pwm_outputs,node_pwm_fade,node_fade_led,node_buzzer_tones,node_buzzer,node_dac_test,node_dac_led,node_blinking_led,node_blink_led toneMint
class node_button_interrupt,node_interrupt_led,node_timer_interrupt,node_timer_led toneRose
```

## Components

### User interaction

- [Button counter](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-01/main.cpp): `homework-01/main.cpp`
- [Counter OLED](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-01/main.cpp): `homework-01/main.cpp`
- [OLED setup demo](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week4%20part2/main.cpp): `week4 part2/main.cpp`

### Sensor monitoring

- **DHT11 sensor**
- [Environment monitor](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%205/main.cpp): `week 5/main.cpp`
- **Light sensor**
- [LDR monitor](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%207/main.cpp): `week 7/main.cpp`
- **OLED display**

### Signal output

- [Dual PWM monitor](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/homework-2/main.cpp): `homework-2/main.cpp`
- **PWM LEDs**
- [DAC/PWM test](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/main.cpp): `main.cpp`
- **DAC and PWM outputs**
- [PWM LED fade](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%206/main.cpp): `week 6/main.cpp`
- **Fade LED**
- [Buzzer tones](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%206%20part%202/main.cpp): `week 6 part 2/main.cpp`
- **Buzzer**
- [DAC LED test](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%208/main.cpp): `week 8/main.cpp`
- **DAC LED output**
- [Blinking LED sketch](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week2/main.cpp): `week2/main.cpp`
- **LED output**

### Interrupt examples

- [Button interrupt](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%203/main.cpp): `week 3/main.cpp`
- **Interrupt LED**
- [Timer interrupt](https://github.com/ibn-e-shahid/24-ntu-cs-fl-1010/blob/main/week%204/main.cpp): `week 4/main.cpp`
- **Timer LED**

### Other components

- **Button user**

## Connections

- Button user → Button counter: presses (evidence: `homework-01/main.cpp`)
- Button counter → Counter OLED: updates (evidence: `homework-01/main.cpp`)
- Button counter → Button user: reports count (evidence: `homework-01/main.cpp`)
- Environment monitor → DHT11 sensor: reads (evidence: `week 5/main.cpp`)
- Environment monitor → OLED display: renders readings (evidence: `week 5/main.cpp`)
- LDR monitor → Light sensor: samples (evidence: `week 7/main.cpp`)
- LDR monitor → OLED display: renders values (evidence: `week 7/main.cpp`)
- Dual PWM monitor → PWM LEDs: drives brightness (evidence: `homework-2/main.cpp`)
- Dual PWM monitor → OLED display: renders status (evidence: `homework-2/main.cpp`)
- DAC/PWM test → DAC and PWM outputs: writes values (evidence: `main.cpp`)
- PWM LED fade → Fade LED: fades brightness (evidence: `week 6/main.cpp`)
- Buzzer tones → Buzzer: sets tones (evidence: `week 6 part 2/main.cpp`)
- DAC LED test → DAC LED output: writes levels (evidence: `week 8/main.cpp`)
- Blinking LED sketch → LED output: toggles output (evidence: `week2/main.cpp`)
- Button interrupt → Interrupt LED: toggles on press (evidence: `week 3/main.cpp`)
- Timer interrupt → Timer LED: toggles each second (evidence: `week 4/main.cpp`)
