from machine import Pin,ADC
from utime import sleep 
import neopixel 
import random
import time

NUM_LEDS = 16

leds = neopixel. NeoPixel (Pin(15), NUM_LEDS)
pot=Pin(4,Pin.IN)
potval=ADC(pot)

while True:
    for x in range(NUM_LEDS):
        speed=int(potval.read())
        speed/=1000
        print(speed)

        leds[x]=[255,255,255]
        leds.write()
        sleep(speed)
        leds[x]=[0,0,0]
        leds.write()