Can you make your Ping do something simpler, like turn on an LED if it's within 15cm of an object? Maybe get the motors working in one sketch, like with your push button, then get the Ping working in another Sketch, like with an LED and then work on combining the two sketches?