import time
import us100
from machine import Pin

uart = machine.UART(0)
sensor = us100.US100UART(uart)

distance=0

def measure():
    global distance
    distance=sensor.distance()
    return distance
    


"""
PINS Set pins like below  (MUST SHARE A GROUND)
p0=Pin(0,Pin.OUT,Pin.PULL_UP) CAN'T USE PIN 0, already being used by LED strip
p0.high()
p1
p2
p3
p4
p5
p6
p7
p8
p9
p10

volU (connect to V+)
volD (connect to V_)

R    (connect to RST)
"""

#TODO create func to grab correct Pin and pass to trig(p) i.e. trig(p0)
def trig(p):
    p.low()
    time.sleep_ms(125)
    p.high()
    