Making vehicle stop in front of wall using stepper motor and ultrasonic (HELP)

gifted:
I tried taking another approach, would this work?

You should get into the habit of testing your program before asking questions about it.

I don't have a sonar device so I don't know how they behave.

...R