#Sonic sensor, HRsr something
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

#The trig and echo pin
TRIG = 23
ECHO = 24

GPIO.setup(TRIG,GPIO.OUT)
GPIO.setup(ECHO,GPIO.IN)

GPIO.output(TRIG, True)
time.sleep(0.1)
GPIO.output(TRIG, False)

while GPIO.input(ECHO) == False:
    start = time.time()

while GPIO.input(ECHO) == True:
    end = time.time()

sig_time = end-start

distance = sig_time / 0.000058

print('Distance: {} centimeters'.format(distance))

GPIO.cleanup()
