# juanmercadin/receptorrf architecture

> Architecture diagram of the GitHub repository juanmercadin/receptorrf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juanmercadin/receptorrf
- Repository: https://github.com/juanmercadin/receptorrf

## Overview

##### Project type and purpose
- This is an Arduino “embedded-system” library (an open-source tool) for receiving fixed-code RF signals (12, 24, etc. bits).
- Its purpose is to abstract the low-level timing and decoding of RF pulses so that user sketches can easily read remote-control codes.

##### File structure
- Top-level:
- /src – library implementation (ReceptorRF.cpp + ReceptorRF.h)
- /examples – multiple Arduino example sketches demonstrating blocking/non-blocking modes, EEPROM support, etc.
- keywords.txt, library.properties – metadata for the Arduino IDE
- There are no backend/frontend distinctions; instead you have hardware, library core, and user application layers.

##### README for additional insights
- Describes four public API calls: configurarRF(), obtenerCodigo(), deshabilitarRF(), habilitarRF()

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Hardware Layer
    RF["RF Receiver Module (433 MHz)"]:::hardware
    UNO["Arduino UNO\nDigital Pin 13"]:::hardware
    Circuit["Circuit Diagram Asset"]:::asset

    %% Library Core Layer
    subgraph "Library Core"
        RFR["ReceptorRF Library"]:::library
        Meta["library.properties\nkeywords.txt"]:::library
    end

    %% Examples Layer
    subgraph "Example Sketches"
        E1["Basico.ino"]:::examples
        E2["Basico_bloqueante.ino"]:::examples
        E3["Codigo_coincidente.ino"]:::examples
        E4["Codigo_coincidente_EEPROM.ino"]:::examples
        E5["Codigo_coincidente_EEPROM_bloqueante.ino"]:::examples
        E6["Codigo_coincidente_bloqueante.ino"]:::examples
    end

    %% External Layer
    Serial["Serial Interface (UART)"]:::external
    Host["Host PC\nSerial Monitor"]:::external

    %% Data Flows
    RF -->|"pulse stream"| UNO
    Circuit -.->|"reference"| UNO
    UNO -->|"ISR/Timer Input"| RFR
    Meta -->|"IDE discovers library"| RFR
    RFR -->|"obtenerCodigo() → byte[]"| E1
    RFR -->|"obtenerCodigo() → byte[]"| E2
    RFR -->|"obtenerCodigo() → byte[]"| E3
    RFR -->|"obtenerCodigo() → byte[]"| E4
    RFR -->|"obtenerCodigo() → byte[]"| E5
    RFR -->|"obtenerCodigo() → byte[]"| E6
    E1 -->|"Serial.print"| Serial
    E2 -->|"Serial.print"| Serial
    E3 -->|"Serial.print"| Serial
    E4 -->|"Serial.print"| Serial
    E5 -->|"Serial.print"| Serial
    E6 -->|"Serial.print"| Serial
    Serial -->|"data"| Host

    %% Click Events
    click RFR "https://github.com/juanmercadin/receptorrf/blob/main/src/ReceptorRF.cpp"
    click Meta "https://github.com/juanmercadin/receptorrf/blob/main/library.properties"
    click E1 "https://github.com/juanmercadin/receptorrf/blob/main/examples/Basico/Basico.ino"
    click E2 "https://github.com/juanmercadin/receptorrf/blob/main/examples/Basico_bloqueante/Basico_bloqueante.ino"
    click E3 "https://github.com/juanmercadin/receptorrf/blob/main/examples/Codigo_coincidente/Codigo_coincidente.ino"
    click E4 "https://github.com/juanmercadin/receptorrf/blob/main/examples/Codigo_coincidente_EEPROM/Codigo_coincidente_EEPROM.ino"
    click E5 "https://github.com/juanmercadin/receptorrf/blob/main/examples/Codigo_coincidente_EEPROM_bloqueante/Codigo_coincidente_EEPROM_bloqueante.ino"
    click E6 "https://github.com/juanmercadin/receptorrf/blob/main/examples/Codigo_coincidente_bloqueante/Codigo_coincidente_bloqueante.ino"
    click Circuit "https://github.com/juanmercadin/receptorrf/tree/main/Img"

    %% Styles
    classDef hardware fill:#a2d5c6,stroke:#333,stroke-width:1px
    classDef library fill:#8fb9f6,stroke:#333,stroke-width:1px
    classDef examples fill:#f6c78f,stroke:#333,stroke-width:1px
    classDef external fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef asset fill:#e9c6f6,stroke:#333,stroke-width:1px
```
