HI! We are Team 3131 Gladstone Robotics, and we need help on programming a 4 CIM robot to drive. In the past, we have only used 2 CIM’s. But this year we are using 4. We have 2 CIM’s on each side of the robot. We don’t know what to do and would love the help. We are using VSCode Java for our programming software and language. Thank you in advance for the help!
So there are a few way to skin that particular cat. Depending on your motor controller, you could use follower mode (CAN / smart motor controllers), WPILib’s SpeedControllerGroup, or PWM splitter cables. Likely the middle option is most sensible for you. Please share what motor controllers you’re using if you’d like a more definitive answer on the “optimal” way to approach this problem.
The general gist is that instead of commanding each “motor”, you’d command the speed controller group (or with follower it’d be commanding two motor controllers and the others output what those “parent” ones were commanded to do).
This example from WPILib has a differentialdrive object in use, you’d construct a differentialdrive object of two speedcontrollergroups and pass that in instead.