Using an ultrasonic sensor to control motor to move in the forward and reverse direction

No it's not what want . i want it to stop rotating after the forward movement until it is triggered to reverse.