Skip to content

Commit ea480f4

Browse files
committed
Update README understanding code section
1 parent a35aaaa commit ea480f4

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

examples/led-matrix-painter/README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ Web Browser ──► HTTP API ──► Python Backend ──► Router B
9191

9292
## Understanding the Code
9393

94-
### 📦 Data Model (`app_frame.py`)
94+
### 🔧 Backend (`main.py`, `store.py` & `app_frame.py`)
9595

96-
The `AppFrame` class is the core data structure that acts as a bridge between the different components. It extends the base `Frame` class to add application-specific metadata like `id`, `name`, `position`, and `duration`.
96+
The Python backend manages the application logic, database, and hardware communication.
9797

98-
It handles three distinct data contracts:
99-
- **API Contract**: `to_json()` / `from_json()` formats data for the web frontend.
100-
- **Database Contract**: `to_record()` / `from_record()` formats data for `SQLStore` storage.
101-
- **Hardware Contract**: `to_board_bytes()` packs pixels into the specific byte format expected by the Arduino sketch.
98+
- **Data Model (`app_frame.py`)**: The `AppFrame` class is the core data structure that acts as a bridge between the different components. It extends the base `Frame` class to add application-specific metadata like `id`, `name`, `position`, and `duration`. It handles three distinct data contracts:
99+
- **API Contract**: `to_json()` / `from_json()` formats data for the web frontend.
100+
- **Database Contract**: `to_record()` / `from_record()` formats data for `SQLStore` storage.
101+
- **Hardware Contract**: `to_board_bytes()` packs pixels into the specific byte format expected by the Arduino sketch.
102102

103103
```python
104104
class AppFrame(Frame):
@@ -113,10 +113,6 @@ class AppFrame(Frame):
113113
}
114114
```
115115

116-
### 🔧 Backend (`main.py` & `store.py`)
117-
118-
The Python backend manages the application logic, database, and hardware communication.
119-
120116
- **Initialization**:
121117
- `designer = FrameDesigner()`: Initializes the frame designer utility from `arduino.app_utils`, which provides the logic for transformation operations (invert, rotate, flip).
122118
- `store.init_db()`: Creates the SQLite database and tables for storing frames if they don't exist.

0 commit comments

Comments
 (0)