View Single Post
  #2   Spotlight this post!  
Unread 18-12-2008, 13:21
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: Pointers and Tank Drive?

well, in my experience with the C++ for the cRIO with WPILib.h,

in the definition for your robot class, you need to have something like this:

Joystick* leftStick;
Joystick* rightStick; //the *'s mean they're a pointer.
RobotDrive* myRobot;

Then in the constructor, you need to have something like:

leftStick = new Joystick(1); //joystick in DS port 1
rightStick = new Joystick(2); //DS port 2
myRobot = new RobotDrive(1,2,3,4); //4 motor drive, with the motors connected to PWM1,2,3,4, on sidecar 1.

and then in the operator control bit, you need something like:

myRobot->TankDrive(leftStick, rightStick);