How valery3107/arquitectura_pc works
1. Repository shape
- This is a single-sketch ESP32 embedded application: AZUL.ino contains the firmware, and README.md describes the hardware and features.
- The architecture is therefore mostly monolithic at the source level, but functionally split into independent runtime subsystems.
2. Execution environment
- The target runtime is Arduino-style firmware on an ESP32.
- The app depends on attached peripherals: TFT display, capacitive/resistive touch controller, microSD, DHT11 sensor, buzzer, and LED.
3. Main orchestration layer
- The sketch likely has one central setup()/loop() lifecycle controlling initialization and then continuously polling the UI, touch input, sensor reads, storage access, and game state.
- This is the top-level boundary that coordinates all features rather than delegating to separate services or processes.
4. Display and UI subsystem
- The ILI9341 TFT screen is the main output surface.
- The UI provides a touch-driven menu system with a “Midnight Emerald” theme, showing feature pages and status views.
- This is the primary user-facing boundary: all major functions are selected and viewed through this screen.
5. Touch input subsystem
- The XPT2046 touch controller is the interaction input channel.
- Touch is used both for menu navigation and for the Snake game’s on-screen D-pad controls.
- Input is thus shared between the shell-like menu and the game mode, making touch a cross-cutting dependency.
6. Environmental sensing subsystem
- The DHT11 provides temperature and humidity readings.
- These readings are displayed in the UI as a live system-status page, so the sensor data flows from hardware into the display layer with no external storage or network involved.
7. Storage/files subsystem
- The microSD card adds file-system-backed content browsing.
- The app supports directory navigation, file viewing, and a notes reader for notes.txt.
- This is the only persistent data source in the repo, and it is accessed locally on-device through the UI.
8. Game subsystem
- The Snake game is an isolated runtime mode with its own game loop, score tracking, collision/game-over logic, and redraw behavior.
- It uses the same display and touch input hardware as the main menu, but it is logically separate from the informational and file-browsing features.
9. Audio and feedback subsystem
- The passive buzzer provides auditory feedback for interactions and game events.
- The LED acts as a lightweight status indicator.
- These are auxiliary outputs that reinforce state changes, selection actions, and gameplay events.
10. System information / diagnostics view
- The README mentions a hardware/system info section showing peripheral state and pin configuration.
- Architecturally, this is a read-only diagnostic page fed by the current runtime configuration rather than a separate subsystem.
11. Data flow summary
- Hardware inputs come from touch, DHT11, and SD.
- The sketch interprets those inputs in firmware, then renders results to the TFT, with side effects to buzzer/LED.
- There is no cloud, no networking, and no inter-device messaging in the described architecture.
12. Key architectural boundary
- The important separation for a diagram is between:
- Physical peripherals on the ESP32 pins, and
- Feature modes inside the firmware: menu, sensor view, SD browser, notes viewer, Snake game, and system info.
- The repo is best drawn as a single embedded controller at the center, with all peripherals connected directly and all features multiplexed through the same UI loop.
Main entry points: AZUL.ino Main loop
Components 15
Firmware
Single ESP32 sketch and its runtime feature modes
- AZUL.ino · Single Arduino-style firmware entry point with setup/loop orchestration
AZUL.ino - Main loop · Initializes hardware and multiplexes menu, sensing, storage, and game modes
AZUL.ino - Touch menu · Main navigation hub for feature pages and status views
AZUL.ino - Sensor view · Displays live temperature and humidity readings
AZUL.ino - SD browser · Navigates directories and browses files from the microSD card
AZUL.ino - Notes reader · Specialized viewer for notes.txt content
AZUL.ino - Snake game · Independent gameplay loop with score, collisions, and redraws
AZUL.ino - System info · Read-only hardware and pin-configuration overview
AZUL.ino
Hardware
Directly attached peripherals and outputs
- TFT screen · ILI9341 display surface for all UI, status, and game rendering
- Touch panel · XPT2046 touch controller used for navigation and game input
- DHT11 · Temperature and humidity source for the status page
- microSD · Local file-system storage for directory browsing and notes
- Buzzer · Audible feedback for interactions and gameplay events
- LED · Lightweight state indicator for feedback and status
- notes.txt · Dedicated text note read by the notes viewer
Connections 24
- AZUL.ino → Main loop: runs · Firmware entry point hands control to the main runtime
- Main loop → Touch menu: opens · Main loop presents the navigation shell
- Main loop → Sensor view: routes · Dispatches into live sensor/status rendering
- Main loop → SD browser: routes · Dispatches into SD browsing mode
- Main loop → Notes reader: routes · Dispatches into the notes reader
- Main loop → Snake game: routes · Dispatches into the Snake game loop
- Main loop → System info: routes · Dispatches into the hardware info page
- Touch menu → Touch panel: uses · Menu navigation is driven by touch input
- Touch menu → TFT screen: renders · Menu pages and themed UI are drawn to the display
- Sensor view → DHT11: reads · Fetches live temperature and humidity values
- Sensor view → TFT screen: renders · Shows sensor readings on screen
- SD browser → microSD: reads · Lists directories and opens files from storage
- SD browser → TFT screen: renders · Displays file and directory views
- Notes reader → notes.txt: opens · Loads the dedicated notes document
- Notes reader → microSD: reads · Sources note content from the SD card
- Notes reader → TFT screen: renders · Shows note text on the display
- Snake game → Touch panel: controls · Uses on-screen touch input as a D-pad
- Snake game → TFT screen: draws · Redraws the board, snake, and score
- Snake game → Buzzer: signals · Emits gameplay feedback sounds
- Snake game → LED: signals · Uses LED feedback during game events
- System info → TFT screen: renders · Shows peripheral and pin configuration
- System info → Touch panel: reports · Includes touch hardware state in diagnostics
- System info → DHT11: reports · Includes sensor presence or readings in diagnostics
- System info → microSD: reports · Includes storage state in diagnostics