Skip to content

Commit 59fa77d

Browse files
committed
Update README
1 parent d12ad1d commit 59fa77d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

examples/led-matrix-painter/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The LED Matrix Painter example uses the following Bricks:
3939
## How to Use the Example
4040

4141
1. **Run the App**
42-
Launch the App from Arduino App Lab.
42+
Launch the App clicking the **Run** button from Arduino App Lab.
4343

4444
2. **Access the Editor**
4545
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:
6969
- Toggle the **Code panel** switch in the top right header to view the C++ code for the current frame or animation in real-time.
7070
- Click the **Export .h** button to download a header file containing your selected designs, ready to be included in an Arduino sketch.
7171

72-
7372
## How it Works
7473

7574
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
9594

9695
The Python backend manages the application logic, database, and hardware communication.
9796

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.
99100

100-
```python
101-
# store.py
102-
def save_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.
108108

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.
110110

111111
```python
112112
# main.py

0 commit comments

Comments
 (0)