We are having a problem that occurs when plugging in an encoder.
The encoder is wired into 2 digital I/O ports on the digital sidecar, with careful attention made to plugging in gnd and signal to one port and 5v and signal to other port. The problem occurs even when plugged into any 2 ports.
With the encoder wired, when the code is enabled, and in teleop mode, the motors start to run, with no joystick input.
With the encoder unplugged, everything works as expected, with no movement until the joystick is moved.
We are using C++ and this happens even when deploying the FRC Default Program (current with imaging tool), which when loaded into workbench is titled BuiltinDefaultCode.
That code does not explicitly reference digital input ports or the encoder classes at all.
Why does hardware plugged into the digital I/O ports effect the motor control?
The only thing I can think of is that maybe your Digital Sidecar is having power issues and the PWM signals are losing integrity. Are the BATT and +5v LEDs lit?
That sounds like you don’t have 12 volts being supplied to the Digital Sidecar. Can you measure the voltage on its power connector? Make sure you haven’t accidentally captured the insulation instead of the conductor in the red and black Wago terminals from the Power Distribution Board.
Our team found out about shorting the digital sidecar this year too. One of them accidentally shorted the PWM signal for a Victor controller to the +12 V power on the Victor. All of the motors on the robot activated momentarily. Scratch one digital sidecar.
Lessons learned:
power down the robot before messing with the wiring.
Even though FIRST has done a lot to make the control systems safe, there are still failures that can cause the robot to behave unexpectedly. Always make sure everyone that is anywhere near the robot is paying attention whenever you power it up!