import machine
import utime
LeD0 = machine.Pin(0, machine.Pin.OUT)
LeD1 = machine.Pin(1, machine.Pin.OUT)
LeD2 = machine.Pin(2, machine.Pin.OUT)
LeD3 = machine.Pin(3, machine.Pin.OUT)
LeD4 = machine.Pin(4, machine.Pin.OUT)
LeD5 = machine.Pin(5, machine.Pin.OUT)
LeD6 = machine.Pin(6, machine.Pin.OUT)
Bp = machine.Pin(15, machine.Pin.IN, machine.Pin.PULL_DOWN)
Pot = machine.ADC(26)
conversionfactor = 1.5 / (65535)
while True:
if (Bp.value() == 0):
Val = Pot.read_u16() * conversionfactor
LeD3.value(1)
utime.sleep(Val+0.2)
LeD3.value(0)
utime.sleep(Val+1)
LeD1.value(1)
LeD5.value(1)
utime.sleep(Val+0.2)
LeD1.value(0)
LeD5.value(0)
utime.sleep(Val+1)
LeD1.value(1)
LeD3.value(1)
LeD5.value(1)
utime.sleep(Val+0.2)
LeD1.value(0)
LeD3.value(0)
LeD5.value(0)
utime.sleep(Val+1)
LeD0.value(1)
LeD2.value(1)
LeD4.value(1)
LeD6.value(1)
utime.sleep(Val+0.2)
LeD0.value(0)
LeD2.value(0)
LeD4.value(0)
LeD6.value(0)
utime.sleep(Val+1)
LeD0.value(1)
LeD2.value(1)
LeD3.value(1)
LeD4.value(1)
LeD6.value(1)
utime.sleep(Val+0.2)
LeD0.value(0)
LeD2.value(0)
LeD3.value(0)
LeD4.value(0)
LeD6.value(0)
utime.sleep(Val+1)
LeD0.value(1)
LeD1.value(1)
LeD2.value(1)
LeD4.value(1)
LeD5.value(1)
LeD6.value(1)
utime.sleep(Val+0.2)
LeD0.value(0)
LeD1.value(0)
LeD2.value(0)
LeD4.value(0)
LeD5.value(0)
LeD6.value(0)
utime.sleep(Val+1)