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

In your stepper code, create a function that steps the motor 1 step. Step the motor 1 step, check the distance. If the distance is below the threshold (close to the wall), stop the stepping. If not, step the motor 1 time, check the distance. Keep going until the robot is as close as you want (threshold).