Servo motor with a ultrasonic sensor

You probably mean

distance_cm = duration_us  / 4;