View Single Post
  #3   Spotlight this post!  
Unread 14-01-2012, 02:40
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Need help coding the jaguars

You need to find out how the Jaguars are connected to the cRIO. There are two ways. You are either connecting the Jaguars to the PWM channels or you are connecting them to a CAN bus by the RJ-12 cables. The way they are connected to the cRIO affects how they are programmed. If you are using CAN bus, you need to declare CANJaguar objects. If you are using PWM, then you declare Jaguar objects. What slot in the cRIO is your digital module plugged into? If your robot is 2-motor drive and you have an 8-slot cRIO with the digital module on slot 4 and connect them through PWM, then you need to declare the Jaguars like this:
Code:
class MyRobot: public SimpleRobot
{
    RobotDrive drive;
 
    MyRobot():
        drive(PWM_CHANNEL_LEFTJAG, PWM_CHANNEL_RIGHTJAG)
    {
        // You may want to flip the booleans if the motors running the wrong way.
        drive.SetInvertedMotor(kRearLeftMotor, true);
        drive.SetInvertedMotor(kRearRightMotor, false);
        ...
        ...
    }
}
__________________

Last edited by mikets : 14-01-2012 at 02:44.
Reply With Quote