View Single Post
  #39   Spotlight this post!  
Unread 28-01-2010, 18:14
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Black jaguars: not working

Quote:
Originally Posted by Bryscus View Post
P.S.S.S. Here's an example of what my code would be using CAN over the serial port.

Code:
#include "WPILib.h"
#include "CANJaguar.h"



class Spy : public SimpleRobot
{
	CANJaguar *mtr;

public:
	Spy(void)
	{	
                mtr = new CANJaguar (5);  //or whatever ID you have set
		GetWatchdog().SetEnabled(false);
	}

	void Autonomous(void)
	{

	}

	void OperatorControl(void)
	{

		while (true) {
			mtr->Set(0.5);
			Wait(0.5);
		}
	}
};

START_ROBOT_CLASS(Spy);
And because of the unified architecture, the exact same code will work with the 2CAN with no modifications (or even rebuilding) by simply changing which driver plugin is configured to load on startup. It may be good to get a baseline with serial so you know the robot code is OK, then switch to the 2CAN plugin and see if there might be a problem with it.

-Joe
Reply With Quote