Distance Sensor

I can’t get the distance sensor to work. I set the min and max values and put my instruction in a waituntil command, but it still does not stop at the designated distance. This would be a tremendous help in our programming. Does anyone have any suggestions?

Does the sensor definitely work? Press the X on the Brain to access settings menu, then go to the Device Info menu. Use the up and down arrow to navigate to the port that has the distance sensor and check it is working and giving good data. What programming language?