from machine import Pin, time_pulse_us import time # Measure the pulse width in microseconds time_pulse_us(15, 1, 5000000) p15 = Pin(15, Pin.IN, Pin.PULL_UP) while True: x = time_pulse_us(15, 11) print(x) time.sleep(0.1)