When I downloaded the code to my robot nothing happened. I made sure the input and output wires were plugged in to the correct slot and the battery was fully charged, and still nothing happened. Then when I went to open the test code for the ultrasonic sensor, accidentally, I saved my code over the test code. If someone could post the test code or has any other ideas why my ultrasonic sensor isn’t working, please help.
There may be several reasons why you are not getting any response. If you provided a copy of the code written it would be helpful. One thing that you will want to make sure of is when you turn on the robot, that the object you are trying to sense distance to is not more than about 21 feet in front of the sensors. That is about the limit of their range.
One source of these symptoms is if the sensor / microcontroller hardware connections are incorrect.
Make SURE that the cable marked “INPUT” on the Ultrasonic Sensor is plugged into a Microcontroller OUTPUT port, and that the cable marked “OUTPUT” on the Ultrasonic Sensor is plugged into a Microcontroller INTERRUPT port. Some Vex documentation I saw on this sensor said to plug both cables into microcontroller INTERRUPT ports, which is wrong. It’s also easy to make a mistake by reversing connections, eg OUTPUT to OUTPUT, etc.