from machine import Pin
from hcsr04 import HCSR04
import time

medidor=HCSR04(trigger_pin=4, echo_pin=5)
led=Pin(2, Pin.OUT)

while True:
  distancia=medidor.distance_cm()
  print("Distancia: ", distancia)
  if distancia <= 20:
    print("Movimiento detectado")
  else: 
    print("No hay movimiento")