import board, time, digitalio
from analogio import AnalogIn

pot = AnalogIn(board.A0)

led1 = digitalio.DigitalInOut(board.GP1)
led1.direction = digitalio.Direction.OUTPUT
led2 = digitalio.DigitalInOut(board.GP2)
led2.direction = digitalio.Direction.OUTPUT
led3 = digitalio.DigitalInOut(board.GP3)
led3.direction = digitalio.Direction.OUTPUT
led4 = digitalio.DigitalInOut(board.GP4)
led4.direction = digitalio.Direction.OUTPUT
led5 = digitalio.DigitalInOut(board.GP5)
led5.direction = digitalio.Direction.OUTPUT
led6 = digitalio.DigitalInOut(board.GP6)
led6.direction = digitalio.Direction.OUTPUT

led11 = digitalio.DigitalInOut(board.GP10)
led11.direction = digitalio.Direction.OUTPUT
led12 = digitalio.DigitalInOut(board.GP11)
led12.direction = digitalio.Direction.OUTPUT
led13 = digitalio.DigitalInOut(board.GP12)
led13.direction = digitalio.Direction.OUTPUT
led14 = digitalio.DigitalInOut(board.GP13)
led14.direction = digitalio.Direction.OUTPUT
led15 = digitalio.DigitalInOut(board.GP14)
led15.direction = digitalio.Direction.OUTPUT
led16 = digitalio.DigitalInOut(board.GP15)
led16.direction = digitalio.Direction.OUTPUT

led21 = digitalio.DigitalInOut(board.GP16)
led21.direction = digitalio.Direction.OUTPUT
led22 = digitalio.DigitalInOut(board.GP17)
led22.direction = digitalio.Direction.OUTPUT
led23 = digitalio.DigitalInOut(board.GP18)
led23.direction = digitalio.Direction.OUTPUT
led24 = digitalio.DigitalInOut(board.GP19)
led24.direction = digitalio.Direction.OUTPUT
led25 = digitalio.DigitalInOut(board.GP20)
led25.direction = digitalio.Direction.OUTPUT
led26 = digitalio.DigitalInOut(board.GP21)
led26.direction = digitalio.Direction.OUTPUT


while True:
  led_delay = abs(((pot.value/65536)-1))
  print(led_delay)
  led1.value = True
  led11.value = True
  led21.value = True
  time.sleep(led_delay)
  led1.value = False
  led11.value = False
  led21.value = False
  led2.value = True
  led12.value = True
  led22.value = True
  led_delay = abs(((pot.value/65536)-1))
  print(led_delay)
  time.sleep(led_delay)
  led2.value = False
  led12.value = False
  led22.value = False
  led3.value = True
  led13.value = True
  led23.value = True
  led_delay = abs(((pot.value/65536)-1))
  print(led_delay)
  time.sleep(led_delay)
  led3.value = False
  led13.value = False
  led23.value = False
  led4.value = True
  led14.value = True
  led24.value = True
  led_delay = abs(((pot.value/65536)-1))
  print(led_delay)
  time.sleep(led_delay)
  led4.value = False
  led14.value = False
  led24.value = False
  led5.value = True
  led15.value = True
  led25.value = True
  led_delay = abs(((pot.value/65536)-1))
  print(led_delay)
  time.sleep(led_delay)
  led5.value = False
  led15.value = False
  led25.value = False
  led6.value = True
  led16.value = True
  led26.value = True
  time.sleep(led_delay)
  led_delay = abs(((pot.value/65536)-1))
  print(led_delay)
  time.sleep(led_delay)
  led6.value = False
  led16.value = False
  led26.value = False
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT