Trying to control motor with Ping ultrasonic sensor

To get help here say what the code does and also what you want it to do.
Simply posting code and letting people guess where you are having trouble is not going to work.