# asmaklad/arduino-prayer-times architecture

> Architecture diagram of the GitHub repository asmaklad/arduino-prayer-times, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asmaklad/arduino-prayer-times
- Repository: https://github.com/asmaklad/arduino-prayer-times

## Overview

This is an Arduino library for calculating daily Islamic prayer times from a date, location, and timezone. An Arduino application supplies those inputs to the public calculation API; the library derives the Julian date, iteratively computes prayer times from solar position, applies timezone and high-latitude adjustments, and can split a decimal time into hours and minutes. The README also identifies an example sketch and the external Time library prerequisite. The sketch was not excerpted, so its calls and any use of Time are not verified.

Main entry points: [`PrayerTimes.cpp`](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp) (Prayer time API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_calculation["Time calculation"]
  node_entry["Prayer time API<br/>[PrayerTimes.cpp]"]
  node_julian["Julian date<br/>[PrayerTimes.cpp]"]
  node_daily["Daily calculation<br/>[PrayerTimes.cpp]"]
  node_prayer["Prayer formulas<br/>[PrayerTimes.cpp]"]
  node_solar["Solar position<br/>[PrayerTimes.cpp]"]
  node_adjust["Time adjustments<br/>[PrayerTimes.cpp]"]
end

subgraph group_configuration["Settings and output"]
  node_settings["Calculation settings<br/>[PrayerTimes.cpp]"]
  node_timeparts["Time formatting<br/>[PrayerTimes.cpp]"]
  node_interface["Enums and declarations<br/>[PrayerTimes.h]"]
end

node_application(("Arduino application"))
node_example["Example sketch"]

node_application -.->|"supplies inputs"| node_entry
node_entry -->|"derives date"| node_julian
node_entry -->|"starts calculation"| node_daily
node_daily -->|"iterates formulas"| node_prayer
node_daily -->|"adjusts results"| node_adjust
node_prayer -->|"gets solar data"| node_solar
node_prayer -->|"reads parameters"| node_settings
node_adjust -->|"reads parameters"| node_settings
node_application -.->|"formats time"| node_timeparts

click node_entry "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_julian "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_daily "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_prayer "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_solar "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_adjust "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_settings "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_timeparts "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp"
click node_interface "https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.h"
click node_example "https://github.com/asmaklad/arduino-prayer-times/blob/master/Examples/PrayerTimes_example/PrayerTimes_example.ino"

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_entry,node_julian,node_daily,node_prayer,node_solar,node_adjust toneBlue
class node_settings,node_timeparts,node_interface toneAmber
class node_application toneIndigo
class node_example toneTeal
```

## Components

### Time calculation

- [Prayer time API](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Julian date](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Daily calculation](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Prayer formulas](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Solar position](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Time adjustments](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`

### Settings and output

- [Calculation settings](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Time formatting](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.cpp): `PrayerTimes.cpp`
- [Enums and declarations](https://github.com/asmaklad/arduino-prayer-times/blob/master/PrayerTimes.h): `PrayerTimes.h`

### Other components

- **Arduino application**
- [Example sketch](https://github.com/asmaklad/arduino-prayer-times/blob/master/Examples/PrayerTimes_example/PrayerTimes_example.ino): `Examples/PrayerTimes_example/PrayerTimes_example.ino`

## Connections

- Arduino application → Prayer time API: supplies inputs
- Prayer time API → Julian date: derives date (evidence: `PrayerTimes.cpp`)
- Prayer time API → Daily calculation: starts calculation (evidence: `PrayerTimes.cpp`)
- Daily calculation → Prayer formulas: iterates formulas (evidence: `PrayerTimes.cpp`)
- Daily calculation → Time adjustments: adjusts results (evidence: `PrayerTimes.cpp`)
- Prayer formulas → Solar position: gets solar data (evidence: `PrayerTimes.cpp`)
- Prayer formulas → Calculation settings: reads parameters (evidence: `PrayerTimes.cpp`)
- Time adjustments → Calculation settings: reads parameters (evidence: `PrayerTimes.cpp`)
- Arduino application → Time formatting: formats time
