Quote:
Originally Posted by Trevor_Decker
I know that we declare what port to use for the power distribution block thru out our code for example
Code:
drivetrain = new RobotDrive(1, 2);
But where do we declare what port to use for the Crio, is their a way to use a different port? In case something where to happen to the normal port.
|
Nowhere in code do you specify the power source for the motors. You specify the PWM outputs (from the digital sidecar) which the motor controllers are connected to.
The code you posted is creating a RobotDrive using Jaguar controllers on PWMs 1 and 2 on the default digital sidecar (CRIO slot 4).
If you want to use different PWM outputs you could modify it like so:
Code:
drivetrain = new RobotDrive(3, 4); //Uses PWM outputs 3 and 4.
drivetrain = new RobotDrive(1, 2, 3, 4); //Used PWMs 1 and 2 for the left drives, and 3 and 4 for the right drives.