You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/led-matrix-painter/README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ The LED Matrix Painter example uses the following Bricks:
39
39
## How to Use the Example
40
40
41
41
1.**Run the App**
42
-
Launch the App from Arduino App Lab.
42
+
Launch the App clicking the **Run** button from Arduino App Lab.
43
43
44
44
2.**Access the Editor**
45
45
Open the App in your browser at `<UNO-Q-IP-ADDRESS>:7000`.
@@ -69,7 +69,6 @@ The LED Matrix Painter example uses the following Bricks:
69
69
- Toggle the **Code panel** switch in the top right header to view the C++ code for the current frame or animation in real-time.
70
70
- Click the **Export .h** button to download a header file containing your selected designs, ready to be included in an Arduino sketch.
71
71
72
-
73
72
## How it Works
74
73
75
74
The LED Matrix Painter relies on a synchronized data flow between the browser, the Python backend, and the hardware.
@@ -95,18 +94,19 @@ Web Browser ──► HTTP API ──► Python Backend ──► Router B
95
94
96
95
The Python backend manages the application logic, database, and hardware communication.
97
96
98
-
-**Database Management**: The `store.py` module handles all SQL operations. It ensures frames are stored persistently and retrieved in the correct order.
97
+
-**Initialization**:
98
+
-`designer = FrameDesigner()`: Initializes the frame designer utility from `arduino.app_utils`, which provides the logic for transformation operations (invert, rotate, flip).
99
+
-`store.init_db()`: Creates the SQLite database and tables for storing frames if they don't exist.
99
100
100
-
```python
101
-
# store.py
102
-
defsave_frame(frame: AppFrame) -> int:
103
-
# Logic to calculate position, assign ID, and insert record
104
-
record = frame.to_record()
105
-
db.store("frames", record, create_table=False)
106
-
# ...
107
-
```
101
+
-**API Endpoints**: The backend exposes several HTTP endpoints using `ui.expose_api` to handle frontend requests:
102
+
-`POST /persist_frame`: Saves or updates frames in the database and updates the board.
103
+
-`POST /load_frame`: Loads a specific frame by ID or retrieves the last edited frame.
104
+
-`GET /list_frames`: Returns all saved frames to populate the bottom panel.
105
+
-`POST /play_animation`: Sends a sequence of frames to the Arduino to play as an animation.
106
+
-`POST /transform_frame`: Applies geometric transformations to the pixel data.
107
+
-`POST /export_frames`: Generates the C++ header file content.
108
108
109
-
-**Hardware Update**: The `apply_frame_to_board` function sends the visual data to the microcontroller.
109
+
-**Hardware Update**: The `apply_frame_to_board` function sends the visual data to the microcontroller via the Bridge.
0 commit comments