View Single Post
  #3   Spotlight this post!  
Unread 12-08-2009, 11:19 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

Quote:
Originally Posted by Trevor_Decker View Post
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.
__________________
Eric Haskins KC9JVH
Reply With Quote