Use HC-SR04 Ultrasonic Sensor to move a motor

Don't you want to explain what "didn't work" means?