View Single Post
  #1   Spotlight this post!  
Unread 03-03-2010, 20:44
nighterfighter nighterfighter is offline
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: Solenoid Breakout

What is with the 2,3,11?

I've always just used (1),(2),(3), etc and it has worked fine.

And you cant JUST say rightStick(1). It needs to be declared as a joystick somewhere.

Ex:
Code:
#include "WPILib.h"


class Aweseome1610Robot: public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick leftStick; 
        Joystick rightStick;
        Victor victorOfDoom;



public:
	Aweseome1610Robot(void)
		: myRobot(1, 2)	// left side, right side
		, leftStick(1)
	        , rightStick(2)
                , victorOfDoom(5) //Victor of Doom is on PWM slot 5
	{
		GetWatchdog().SetEnabled(false);
	}

	void RobotMain(void)
	{
		while (true) //Bad practice, dont do that. :P
		{

                   if(rightStick.GetRawButton(1) //Trigger
                  {
                   victorOfDoom.Set(leftStick.GetThrottle()); 
/*Drive the Victor based on the leftSticks throttle, because the Set function accepts a Float value, and GetThrottle returns a float. */
                  }
		}
	}

	
};

START_ROBOT_CLASS(Aweseome1610Robot);
Reply With Quote