Thread: HELP!!
View Single Post
  #3   Spotlight this post!  
Unread 25-03-2010, 06:58
nighterfighter nighterfighter is online now
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: HELP!!

That is one way to do it. However, instead of declaring the Relay as a pointer (*) you can do it this way:

Code:
class Team1771Robot : public SimpleRobot {

RobotDrive driveTrain;
Joystick leftStick;
Joystick rightStick;
Shooter mainShooter;
Relay mySpike; //Declare your spike's name here

public:
	Team1771Robot(void):
 	driveTrain(LEFT_DRIVE_MOTOR_PORT, RIGHT_DRIVE_MOTOR_PORT),
	leftStick(LEFT_JOYSTICK_PORT), 
	rightStick(RIGHT_JOYSTICK_PORT),
	mainShooter(SHOOTER_TENSION_PORT, SHOOTER_RELEASE_PORT),
             mySpike(MYSPIKE_PORT) //Put whatever slot the spike is.

		

	{



	}
	;




Later on in your code, say, in the teleop, you can say

void OperatorControl()
{
while(isOperatorControl() && !isNotDisabled())
{

mySpike.Set(Relay::kOff); //Or forward, reverse, etc.

}
}