I wrote a program for the v5 ultrasonic range finder so that I can have the robot travel to a cube; however, it is detecting all distances as 0.00 mm. I used almost the exact code that is provided in the VEXcode v5 text ultrasonic range finder example code. I only changed the names of the motors. Additionally, I know that the brain is correctly running the program because I printed a line of text. I have also plugged in the input wire into port A and the output wire into port B. I am testing the distance sensor with a large UPS box approximately one foot away from the sensor. However, the sensor detects it as 0 mm away. Any suggestions as to what might be wrong?
Have you tried switching the input and output wires?
either your sensor is damaged, or you have it plugged in incorrectly.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.