I was poking around with some of the internal SDK-provided methods e.g. used in PROS and I came across one specific method I was wondering about.
According to the PROS source, a distance sensor reports that it is ready if its status code returned by vexDeviceDistanceStatusGet is either 0x82 or 0x86:
#define ERROR_DISTANCE_BAD_PORT(device, err_return) \
if (!(vexDeviceDistanceStatusGet(device->device_info) == 0x82 || \
vexDeviceDistanceStatusGet(device->device_info) == 0x86)) { \
errno = EAGAIN; \
return_port(port - 1, err_return); \
}
I’m curious whether there is a difference between the 0x82 and 0x86 status, as from my tests, it looks like the sensor randomly alternates between reporting both codes. Does it have to do with overheating (I’ve noticed the sensor can become warm at times) or is it directly reported from whatever the sensor inside says?