Actually I want to build a project. using arduino uno and sr 04 ultra sonic sensor, I want to control the speed of a dc motor. When the distance is very small, the motor stops rotating. When there is no obstacle, the motor start rotating. Can someone help me in doing this. I want arduino code and required components.