From 61ff895ef97bafeabeed693f115832fde62881c0 Mon Sep 17 00:00:00 2001 From: TheJoeCoder <joe@radialbog9.uk> Date: Tue, 1 Oct 2024 13:03:10 +0100 Subject: [PATCH] Add architecture to the README --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 0da16df..fd28516 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,23 @@ xhost + # Run the clock sudo ./.venv/bin/python3 main.py ``` + +## Architecture +The main system running the software is a Raspberry Pi Zero 2 W. The display is a 240x240 pixel SPI display. + +In terms of software stack: +- The clock's software is written in Python, using the Pygame library for rendering the display. +- The software is multithreaded: + - One thread for the display, which renders the display (with pygame). + - One thread for the LEDs, controlling the patterns (with either neopixel or dummy led libraries). + - One thread for the web server, which serves the configuration page and API endpoints. + - The main thread controls the other threads and handles changes to the configuration. +- Wayland is used as the display server, as it is faster than X11 and works well with the SPI display. +- For operating system we use Raspberry Pi OS Lite, with Wayland and the necessary dependencies installed. + +It's designed to be: +- Modular, with different modules - both widgets for the display and patterns for the LEDs that + can be added or removed. The clock can be configured to display different modules in different orders, + and the modules can be easily created or modified. +- Easily extensible, with a simple API for creating new modules. The clock is also designed to be + easily configurable, with a simple configuration file that can be edited to change the appearance of the clock. -- GitLab