from machine import Pin , Timer
from hc_sr04 import HCSR04

ultrasonic_pins = HCSR04(trigger_pin=2,echo_pin=15,echo_timeout_us=1000000)

def hc_sro4_isr(evebt):
    distance = ultrasonic_pins.distance_cm()
    print("distance: ",distance," cm")

timer_type=Timer(1)
timer_type.init(period=250,mode=Timer.PERIODIC,callback=hc_sro4_isr)