I have a question for using ultrasonic sensor

First, specify what ultrasonic sensor. Do you mean a HC-SR04 ultrasonic rangefinder?

If so, you can write your own code to get the range in feet, millimeters, centimeters, etc. or you can use a library like the NewPing library.