示例#1
0
	RobotDemo(void)		
	{
		kicker_in_motion = false;
		sol = new Solenoid(2);
		rightstick = new Joystick(1);
		leftstick = new Joystick(2);
		lonelystick = new Joystick (3);
		Motor1=new Jaguar(1);
		Motor2=new Jaguar(2);
		Motor3=new Jaguar(3);
		Motor4=new Jaguar(4);
		BallGathererMotor9 = new Jaguar(9);
		myRobot=new RobotDrive(Motor1,Motor2,Motor4,Motor3);
		rlyLED=new Relay(8,Relay::kForwardOnly);
		cam = &AxisCamera::GetInstance("10.8.12.11");
		cam->WriteResolution(AxisCameraParams::kResolution_160x120);
		myRobot->SetExpiration(0.5);
		ControllBox = & DriverStation::GetInstance()->GetEnhancedIO();
		shooter1 = new Jaguar(5); //front left
		shooter2 = new Jaguar(6);
		shooter3 = new Jaguar(7);
		shooter4 = new Jaguar(8);
		//shooterDin = new DigitalInput(1);
		shootercontador = new Counter(1);
		shootercontador->Start();
		shooterspeedTask = new Task("ShooterSpeed",(FUNCPTR)&shooterspeedloop);
		kickerTask = new Task ("Kicker", (FUNCPTR)&kickerloop);
		Upperlimit = new DigitalInput(3);
		Lowerlimit = new DigitalInput(2);
		kickermotor = new Relay (6, Relay::kBothDirections);
		BridgeBootMotor10 = new Jaguar(10);
		kicker_cancel = false;
		kicker_down = false;
		
	}
示例#2
0
	RobotDemo(void):
		myRobot(1, 2),	// these must be initialized in the same order
		stick(1),
		in1(8), in2(7)
	{
		GetWatchdog().SetExpiration(0.1);
		
		// specify the source
		countXhi.SetUpSource(in1);
		countXlow.SetUpSource(in1);
		countYhi.SetUpSource(in2);
		countYlow.SetUpSource(in2);
		
		// setup the counters
		countXhi.SetSemiPeriodMode(true);
		countXlow.SetSemiPeriodMode(false);
		countYhi.SetSemiPeriodMode(true);
		countYlow.SetSemiPeriodMode(false);
		
		countXhi.Start();
		countXlow.Start();
		countYhi.Start();
		countYlow.Start();
	}
示例#3
0
/**
 * Start the Counter counting.
 * This enables the counter and it starts accumulating counts from the associated
 * input channel. The counter value is not reset on starting, and still has the previous value.
 *
 * @param channel The channel of the digital input used with this counter
 */
void StartCounter(UINT32 channel)
{
    Counter *counter = AllocateCounter(channel);
    if (counter != NULL)
        counter->Start();
}
示例#4
0
/**
 * Start the Counter counting.
 * This enables the counter and it starts accumulating counts from the associated
 * input channel. The counter value is not reset on starting, and still has the previous value.
 *
 * @param slot The slot the digital module is plugged into
 * @param channel The channel of the digital input used with this counter
 */
void StartCounter(UINT8 moduleNumber, UINT32 channel)
{
    Counter *counter = AllocateCounter(moduleNumber, channel);
    if (counter != NULL)
        counter->Start();
}