# SPDX-FileCopyrightText: 2025 Pagong # SPDX-License-Identifier: MIT import time import board import neopixel import rainbowio ####################### # for Rpi-Pico with 16x16 NeoPixel-Matrix NUM_COLS = 16 NUM_CELLS = 16 NUM_PIXELS = (NUM_COLS * NUM_CELLS) # Update this to match the number of LEDs. SPEED = 0.01 # Increase to slow down the effect. Decrease to speed it up. BRIGHTNESS = 0.1 # A number between 0.0 and 1.0, where 0.0 is off, and 1.0 is max. PIN = board.GP28 # This is the default pin on my RPi-Pico with 16x16 NeoPixel matrix pixels = neopixel.NeoPixel(PIN, NUM_PIXELS, brightness=BRIGHTNESS, auto_write=False) ##################### black = 0 while True: pixels.fill(black) pixels.show() time.sleep(50*SPEED) for i in range(NUM_PIXELS): for j in range(NUM_PIXELS): color = rainbowio.colorwheel(i+j) pixels[j] = color pixels.show() time.sleep(SPEED)