def basic_distance(trig_pin, echo_pin, celsius=20):
    '''Return an unformatted distance in cm's as read directly from
    RPi.GPIO.'''

    speed_of_sound = 331.3 * math.sqrt(1+(celsius / 273.15))
    GPIO.setup(trig_pin, GPIO.OUT)
    GPIO.setup(echo_pin, GPIO.IN)
    GPIO.output(trig_pin, GPIO.LOW)
    time.sleep(0.1)
    GPIO.output(trig_pin, True)
    time.sleep(0.00001)
    GPIO.output(trig_pin, False)
    echo_status_counter = 1
    while GPIO.input(echo_pin) == 0:
        if echo_status_counter < 1000:
            sonar_signal_off = time.time()
            echo_status_counter += 1
        else:
            raise SystemError('Echo pulse was not received')
    while GPIO.input(echo_pin) == 1:
        sonar_signal_on = time.time()

    time_passed = sonar_signal_on - sonar_signal_off
    return time_passed * ((speed_of_sound * 100) / 2)
Return an unformatted distance in cm's as read directly from
    RPi.GPIO.