import machine, neopixel
import time
np = neopixel.NeoPixel(machine.Pin(4), 16)
def demo(np):
    n = np.n

    # cycle
    for i in range(3 * n):
        for j in range(n):
            np[j] = (0, 0, 244)
        np[i % n] = (255, 255, 255)
        np.write()
        time.sleep_ms(25)

demo(np)