# randomahhname-h/prac-micro architecture

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

- Interactive diagram: https://gitdiagram.com/randomahhname-h/prac-micro
- Repository: https://github.com/randomahhname-h/prac-micro

## Overview

This repository is a collection of independent ATmega328P/AVR practice programs, not one integrated application. Each project’s main source configures peripherals, runs its own loop or interrupt-driven behavior, and interacts directly with hardware or a serial terminal. The graph groups examples by their primary function; it does not imply shared runtime components. The README is empty, and the sampled programs provide the evidence for the shown hardware relationships; unsampled projects are represented only by their source paths.

Main entry points: [`servo with uart/src/main.c`](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/servo%20with%20uart/src/main.c) (Serial servo control), [`I2C n sensor/src/main.cpp`](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/I2C%20n%20sensor/src/main.cpp) (I2C AHT20 reader), [`adc/src/main.c`](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/adc/src/main.c) (ADC averaging display), [`light with 7seg/src/main.cpp`](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/light%20with%207seg/src/main.cpp) (Light and 7-segment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing and display"]
  node_i2c_aht["I2C AHT20 reader<br/>[main.cpp]"]
  node_adc_lcd["ADC averaging display<br/>[main.c]"]
  node_light_display["Light and 7-segment<br/>[main.cpp]"]
  node_pir_monitor["PIR motion monitor<br/>[main.c]"]
end

subgraph group_motion["Motion control"]
  node_servo_sweep["Servo sweep<br/>[main.c]"]
  node_servo_uart["Serial servo control<br/>[main.c]"]
  node_stepper["Step motor pulses<br/>[main.c]"]
end

subgraph group_timing["Timing and input"]
  node_input_capture["Input capture frequency<br/>[main.c]"]
  node_button_timer["Button and timer LEDs<br/>[main.cpp]"]
  node_scheduler["Timer scheduler exercise<br/>[main.c]"]
end

subgraph group_experiments["Other projects"]
  node_test_project["Test project<br/>[main.cpp]"]
  node_test2_project["Test2 project<br/>[main.c]"]
end

node_aht20["AHT20 sensor"]
node_serial_i2c(("Serial monitor"))
node_analog_input["Analog input"]
node_lcd_adc["LCD"]
node_ldr["Light sensor"]
node_seven_segment["7-segment display"]
node_pir_sensor["PIR sensor"]
node_motion_outputs["LED and UART"]
node_servo_motor["Servo"]
node_serial_terminal(("Serial terminal"))
node_stepper_motor["Stepper motor driver"]
node_signal_source["Signal source"]
node_capture_lcd["LCD"]
node_button["Button"]
node_button_outputs["LEDs and buzzer"]

node_i2c_aht -->|"reads over I2C"| node_aht20
node_i2c_aht -->|"prints readings"| node_serial_i2c
node_adc_lcd -->|"samples ADC"| node_analog_input
node_adc_lcd -->|"displays average"| node_lcd_adc
node_light_display -->|"reads ADC"| node_ldr
node_light_display -->|"updates digits"| node_seven_segment
node_pir_monitor -->|"reads state"| node_pir_sensor
node_pir_monitor -->|"signals changes"| node_motion_outputs
node_servo_sweep -->|"sets PWM angle"| node_servo_motor
node_serial_terminal -->|"sends angle"| node_servo_uart
node_servo_uart -->|"sets PWM angle"| node_servo_motor
node_servo_uart -->|"prints status"| node_serial_terminal
node_stepper -->|"sends step pulses"| node_stepper_motor
node_signal_source -->|"provides edges"| node_input_capture
node_input_capture -->|"displays frequency"| node_capture_lcd
node_button -->|"provides presses"| node_button_timer
node_button_timer -->|"toggles outputs"| node_button_outputs

click node_i2c_aht "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/I2C%20n%20sensor/src/main.cpp"
click node_adc_lcd "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/adc/src/main.c"
click node_light_display "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/light%20with%207seg/src/main.cpp"
click node_pir_monitor "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/PIR%20sens%20for%20motion/src/main.c"
click node_servo_sweep "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/servo/src/main.c"
click node_servo_uart "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/servo%20with%20uart/src/main.c"
click node_stepper "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/ctrl%20step%20motor%20(TS%20IS%20BROKEN)/src/main.c"
click node_input_capture "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/input%20capture/src/main.c"
click node_button_timer "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/task1/src/main.cpp"
click node_scheduler "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/timer%20n%20scheduler/src/main.c"
click node_test_project "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/test/src/main.cpp"
click node_test2_project "https://github.com/randomahhname-h/prac-micro/blob/nuocmot/test2/src/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_i2c_aht,node_adc_lcd,node_light_display,node_pir_monitor toneBlue
class node_servo_sweep,node_servo_uart,node_stepper toneAmber
class node_input_capture,node_button_timer,node_scheduler toneMint
class node_test_project,node_test2_project toneRose
class node_aht20,node_serial_i2c,node_analog_input,node_lcd_adc,node_ldr,node_seven_segment,node_pir_sensor,node_motion_outputs,node_servo_motor,node_serial_terminal,node_stepper_motor,node_signal_source,node_capture_lcd,node_button,node_button_outputs toneIndigo
```

## Components

### Sensing and display

- [I2C AHT20 reader](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/I2C%20n%20sensor/src/main.cpp): `I2C n sensor/src/main.cpp`
- [ADC averaging display](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/adc/src/main.c): `adc/src/main.c`
- [Light and 7-segment](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/light%20with%207seg/src/main.cpp): `light with 7seg/src/main.cpp`
- [PIR motion monitor](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/PIR%20sens%20for%20motion/src/main.c): `PIR sens for motion/src/main.c`

### Motion control

- [Servo sweep](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/servo/src/main.c): `servo/src/main.c`
- [Serial servo control](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/servo%20with%20uart/src/main.c): `servo with uart/src/main.c`
- [Step motor pulses](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/ctrl%20step%20motor%20(TS%20IS%20BROKEN)/src/main.c): `ctrl step motor (TS IS BROKEN)/src/main.c`

### Timing and input

- [Input capture frequency](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/input%20capture/src/main.c): `input capture/src/main.c`
- [Button and timer LEDs](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/task1/src/main.cpp): `task1/src/main.cpp`
- [Timer scheduler exercise](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/timer%20n%20scheduler/src/main.c): `timer n scheduler/src/main.c`

### Other projects

- [Test project](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/test/src/main.cpp): `test/src/main.cpp`
- [Test2 project](https://github.com/randomahhname-h/prac-micro/blob/nuocmot/test2/src/main.c): `test2/src/main.c`

### Other components

- **AHT20 sensor**
- **Serial monitor**
- **Analog input**
- **LCD**
- **Light sensor**
- **7-segment display**
- **PIR sensor**
- **LED and UART**
- **Servo**
- **Serial terminal**
- **Stepper motor driver**
- **Signal source**
- **LCD**
- **Button**
- **LEDs and buzzer**

## Connections

- I2C AHT20 reader → AHT20 sensor: reads over I2C (evidence: `I2C n sensor/src/main.cpp`)
- I2C AHT20 reader → Serial monitor: prints readings (evidence: `I2C n sensor/src/main.cpp`)
- ADC averaging display → Analog input: samples ADC (evidence: `adc/src/main.c`)
- ADC averaging display → LCD: displays average (evidence: `adc/src/main.c`)
- Light and 7-segment → Light sensor: reads ADC (evidence: `light with 7seg/src/main.cpp`)
- Light and 7-segment → 7-segment display: updates digits (evidence: `light with 7seg/src/main.cpp`)
- PIR motion monitor → PIR sensor: reads state (evidence: `PIR sens for motion/src/main.c`)
- PIR motion monitor → LED and UART: signals changes (evidence: `PIR sens for motion/src/main.c`)
- Servo sweep → Servo: sets PWM angle (evidence: `servo/src/main.c`)
- Serial terminal → Serial servo control: sends angle (evidence: `servo with uart/src/main.c`)
- Serial servo control → Servo: sets PWM angle (evidence: `servo with uart/src/main.c`)
- Serial servo control → Serial terminal: prints status (evidence: `servo with uart/src/main.c`)
- Step motor pulses → Stepper motor driver: sends step pulses (evidence: `ctrl step motor (TS IS BROKEN)/src/main.c`)
- Signal source → Input capture frequency: provides edges (evidence: `input capture/src/main.c`)
- Input capture frequency → LCD: displays frequency (evidence: `input capture/src/main.c`)
- Button → Button and timer LEDs: provides presses (evidence: `task1/src/main.cpp`)
- Button and timer LEDs → LEDs and buzzer: toggles outputs (evidence: `task1/src/main.cpp`)
