Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/led-matrix-painter/python/app_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: MPL-2.0

import json
import re
from arduino.app_utils import Frame

class AppFrame(Frame):
Expand Down Expand Up @@ -146,10 +147,11 @@ def to_c_string(self) -> str:
Returns:
str: C source fragment containing a const array initializer.
"""
c_type = "uint32_t"
c_type = "uint8_t"
snake_name = re.sub(r'[^a-zA-Z0-9]', '_', self.name.lower())
scaled_arr = self.rescale_quantized_frame(scale_max=255)

parts = [f"const {c_type} {self.name}[] = {{"]
parts = [f"{c_type} {snake_name} [] = {{"]
rows = scaled_arr.tolist()
# Emit the array as row-major integer values, preserving row breaks for readability
for r_idx, row in enumerate(rows):
Expand Down