I want to have the operation of the robot change depending on whether or not the IO board is plugged into the classmate. Normally we have controls through Joystick and PSoC, but there is a special circumstance where the Classmate needs to be portable without anything but the E-Stop button. Is there any way to detect whether the I/O board is connected to the classmate?
You could use one of the input pins as a flag that it is present, as long as you don’t set that input in the virtual I/O controls when it isn’t connected.
If you are using the “Enhanced I/O” mode (truly the enhanced mode, using the DriverStationEnhancedIO class) you can call DriverStationEnhancedIO::GetDigitalConfig() using any legitimate channel number. If the board is not present, it will return DriverStationEnhancedIO::kUnknown.
We had to do this when using the EnhancedIO, wrapping all our runtime EIO calls inside an “if” checking that the Cypress board was plugged in. Without that, repeatedly setting outputs/reading inputs through the DriverStationEnhancedIO would spam errors through to the Driver Station diagnostic window causing poor connectivity between DS and robot.