""" On-device test for Presets.fill_n() using mpremote. Usage (from pico/ dir or project root with adjusted paths): mpremote connect cp src/*.py : mpremote connect cp src/patterns/*.py :patterns mpremote connect cp lib/*.py : mpremote connect cp test/test_fill_n.py : mpremote connect run test_fill_n.py This script: - Instantiates Presets - Calls fill_n() with a simple range - Lets you visually confirm that all strips show the same proportional segment and that equal-length strip pairs have identical lit indices. """ from presets import Presets def main(): presets = Presets() presets.load() # Choose a simple test range on the reference strip (strip 0). ref_len = presets.strip_length(0) if ref_len <= 0: print("No strips or invalid length; aborting fill_n test.") return # Use a central segment so it's easy to see. start = ref_len // 4 end = 3 * ref_len // 4 print("Running fill_n test from", start, "to", end, "on reference strip 0.") color = (0, 50, 0) # dim green # First, clear everything for strip in presets.strips: strip.fill((0, 0, 0)) strip.show() # Apply fill_n, which will use scale() internally. presets.fill_n(color, start, end) print("fill_n test applied; visually inspect strips.") if __name__ == "__main__": main()