Ultrasonic Range Finder

I have got the ultrasonic sensor working on the vex fantastic bot, but when I use the code I wrote on my robot it doesn’t work. We currently have the input cable plugged into the digital port where the actual sensor is selected in robotc and the output cable in the port that is "generated by robotc. What are we missing?

Is it setup correctly in the sensors and motor declaration? Check the live values from the robotc compiler.

I recently wrote a lengthy post on this topic, which includes information on how it must be plugged in, plus information on Ports 4/10, etc. Lots of stuff.