Default VEX V5 C++ API has, at the very least, motor.installed() function to check if motor is connected. I am not sure if there are any accessible undocumented functions which could give you more information regarding port status.
Then, this may a bit to steep of a climb from the block code, but an alternative to the default V5 development environment is Pros , which provides extended API and has more functionality to test for connected device status (see VEX Generic Device C API (For Advanced Users) module | PROS for V5 )
I am working on a piece of code that alerts the program if a device is missing. For example, the program knows that there is a motor in port 1 and detects if there is a device plugged in. I have been looking through the pros include files on GitHub and have found the command:
v5_device_e_t registry_get_plugged_type(uint8_t port);
It is in the pros/include/vdml/registry.h, unfortunately, that file doesn’t exist in my pros project.
Is there another function that can detect if a motor or vision …
If you’re running a decently large program, you probably have a bin of questionable motors. If your program is anything like ours, that bin is probably partially full of motors that students are blaming for their own issues, cables, or overheating.
This quick test software (written in PROS) helps you resolve which motors are actually bad and which can go back in the good motors drawer. It runs the motor through a forward/reverse test for a few seconds and decides if they perform well enough. No…
Over the years people have developed a number of V5 Motor Testers based on that API with source code available on GitHub: example 1 , example 2 , example 3