diff --git a/examples/led-matrix-painter/python/app_frame.py b/examples/led-matrix-painter/python/app_frame.py index db66c9b..b72431b 100644 --- a/examples/led-matrix-painter/python/app_frame.py +++ b/examples/led-matrix-painter/python/app_frame.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: MPL-2.0 import json +import re from arduino.app_utils import Frame class AppFrame(Frame): @@ -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):