I was wondering if anyone knew how to calculate the distance of an object using a vision sensor. Code in either Vex Coding Studio or VEXcode will be helpful. I have heard that you can calculate the distance of an object only if the sensor is angled downwards and I was also wondering if that is true. Any help is appreciated.
check this thread
If you wanted to calculate solely the distance from the robot to an object using the ultrasonic sensor would be better. The Ultrasonic sensor measures solely distance, and can measure up to 255 CM, from all the Ultrasonic sensors I’ve seen:
Ok thanks. Could you provide a website or a piece of code that finds the distance of an object using an ultrasonic sensor in VEXcode?
Here is the API documentation for it: https://api.vexcode.cloud/v5/html/classvex_1_1sonar.html
Do you have vexcode downloaded, it should have built in examples of how to use the Ultrasonic sensor.
I do have it downloaded. I just figured out that once you add the device, the items in the Command Reference show up. Thank you very much!