当前位置: 首页>>代码示例>>C++>>正文


C++ DoubleSolenoid::Get方法代码示例

本文整理汇总了C++中DoubleSolenoid::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleSolenoid::Get方法的具体用法?C++ DoubleSolenoid::Get怎么用?C++ DoubleSolenoid::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DoubleSolenoid的用法示例。


在下文中一共展示了DoubleSolenoid::Get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SquareInputs

	void SquareInputs(void)
	{
		if(stick.GetY() < 0)
		{
			if(DoubleSolenoid::kReverse == shifter.Get())
			{
				myRobot.ArcadeDrive((stick.GetY() * stick.GetY() * -4.0), stick.GetX());
			}
			else if(DoubleSolenoid::kForward == shifter.Get())
			{
				myRobot.ArcadeDrive((stick.GetY() * stick.GetY() * -1.0), stick.GetX());
			}
		}
		else if(stick.GetY() > 0)
		{
			if(DoubleSolenoid::kReverse == shifter.Get())
			{
				myRobot.ArcadeDrive((stick.GetY() * stick.GetY() * 4.0), stick.GetX());
			}
			else if(DoubleSolenoid::kForward == shifter.Get())
			{
				myRobot.ArcadeDrive((stick.GetY() * stick.GetY() * 1.0), stick.GetX());
			}
		}
	}
开发者ID:StWilliam,项目名称:Wham-O,代码行数:25,代码来源:FRC2994_2013.cpp

示例2: LogToDashboard

	void LogToDashboard()
	{
		_arm->logInfo();
		
		_lightSensors->logInfo();
		
		
		//	minibot deployment
		SmartDashboard::Log(MinibotDeployable(), "Minibot Deployable");
		SmartDashboard::Log(_minibotDeployerSolenoid->Get(), "Minibot Deployed");
	}
开发者ID:team3344,项目名称:frc3344_code,代码行数:11,代码来源:FRC2011.cpp

示例3: loadCatapult

	void loadCatapult()
	{
		if (buttonOne.Get()==1 && buttonTwo.Get()==1 && dogSolenoid.Get()==DoubleSolenoid::kReverse)
		{
			dogSolenoid.Set(DoubleSolenoid::kForward);
			Wait(0.5);
			ratchetSolenoid.Set(DoubleSolenoid::kForward);
			Wait(0.5);
			catapultMotor.Set(1);
		}
	}
开发者ID:secant,项目名称:robot2014,代码行数:11,代码来源:AutonomousCodeTest.cpp

示例4: TeleopPeriodic

	void TeleopPeriodic()
	{
		SmartDashboard::PutNumber("joystickX",stick.GetX());
		SmartDashboard::PutNumber("joystickY",stick.GetY());
		//SmartDashboard::PutBoolean("fucking buttons", stick.GetRawButton(1));

		//SmartDashboard::PutNumber("potentiometer voltage", pot.GetVoltage());
		SmartDashboard::PutBoolean("infra",infra.Get());

		SmartDashboard::PutNumber("accelX",accel.GetX());
		SmartDashboard::PutNumber("accelY",accel.GetY());
		SmartDashboard::PutNumber("accelZ",accel.GetZ());

		servo.Set(
			trueMap(stick.GetX(), 1, -1, 1, 0) // trueMap allows use of entire joystick
		);
		SmartDashboard::PutNumber("servo", servo.Get());


		jag1.Set(stick.GetY());
		jag2.Set(stick.GetY());
		//tal1.Set(stick.GetY());

		SmartDashboard::PutNumber("jag1", jag1.Get());
		SmartDashboard::PutNumber("jag2", jag2.Get());


		/*SmartDashboard::PutNumber("encpos", enc.Get());
		SmartDashboard::PutNumber("encspd", enc.GetRate());*/

		if (stick.GetRawButton(1) && !actuatePressed) {
			pistonVal=!pistonVal;
			piston.Set(pistonVal ? DoubleSolenoid::kForward : DoubleSolenoid::kReverse);

			actuatePressed = true;
		}
		else if (!stick.GetRawButton(1))
			actuatePressed = false;

		SmartDashboard::PutBoolean("piston forward", piston.Get() == DoubleSolenoid::kForward);


	}
开发者ID:BlueTideRobotics,项目名称:FRC-2016,代码行数:43,代码来源:Robot.cpp

示例5: HandleDriverInputsAutomatic

	void HandleDriverInputsAutomatic(void)
	{
		//myRobot.ArcadeDrive(stick);
		
		if(DoubleSolenoid::kReverse == shifter.Get())
		{
			if(stick.GetY() < -0.25)
			{
				shifter.Set(DoubleSolenoid::kForward);
			}
		}
		// If the robot is in low gear and is over 0.2 input,
		// then switch into high gear.
		else if(stick.GetY() > -0.2)
		{
			shifter.Set(DoubleSolenoid::kReverse);
		}
		
		SquareInputs();
	}
开发者ID:StWilliam,项目名称:Wham-O,代码行数:20,代码来源:FRC2994_2013.cpp

示例6: Test

	void Test() // DONT TOUCH THIS AREA. I KEEL YOU.
	{
		DriverStationLCD *screen = DriverStationLCD::GetInstance();
		int counter = 0;
		bool solenoidTest=0;
		while (IsTest())
		{
			if(logitech.GetRawButton(9)) //press rightBack
			{
				solenoidTest=1;
				compressor.Start();
			}
			if(logitech.GetRawButton(10)) //press Start
			{
				solenoidTest=0;
				compressor.Stop();
			}
			if(solenoidTest)
			{
				if(logitech.GetRawButton(1)) //press X
				{
					rightArmSolenoid.Set(DoubleSolenoid::kForward);
					leftArmSolenoid.Set(DoubleSolenoid::kForward);
				}
				else if(logitech.GetRawButton(2)) //press A
				{
					rightArmSolenoid.Set(DoubleSolenoid::kReverse);
					leftArmSolenoid.Set(DoubleSolenoid::kReverse);
				}
				else
				{
					leftArmSolenoid.Set(DoubleSolenoid::kOff);
					rightArmSolenoid.Set(DoubleSolenoid::kOff);
				}
				if(logitech.GetRawButton(3)) //PRess URTrigger
				{
					retrievalMotor.Set(logitech.GetRawAxis(2));
				}
				else
				{
					retrievalMotor.Set(0);
				}
				if(logitech.GetRawButton(4))
				{
					winchMotor.Set(logitech.GetRawAxis(2));
				}
				else
				{
					winchMotor.Set(0);
				}
				if(logitech.GetRawButton(5))
				{
					ratchetSolenoid.Set(DoubleSolenoid::kForward);
				}
				else if(logitech.GetRawButton(7))
				{
					ratchetSolenoid.Set(DoubleSolenoid::kReverse);
				}
				else
				{
					ratchetSolenoid.Set(DoubleSolenoid::kOff);
				}
				if(logitech.GetRawButton(6))
				{
					dogSolenoid.Set(DoubleSolenoid::kForward);
				}
				else if(logitech.GetRawButton(8))
				{
					dogSolenoid.Set(DoubleSolenoid::kReverse);
				}
				else
				{
					dogSolenoid.Set(DoubleSolenoid::kOff);
				}
			}
			else
			{
				if(logitech.GetRawButton(1)) //Press X
				{
					rightFront.Set(logitech.GetRawAxis(2)); //Press left joystick
				}
				else
				{
					rightFront.Set(0);
				}
				if(logitech.GetRawButton(2)) //Press A
				{
					rightBack.Set(logitech.GetRawAxis(2));
				}
				else
				{
					rightBack.Set(0);
				}
				if(logitech.GetRawButton(3)) //Press B
				{
					leftFront.Set(logitech.GetRawAxis(2));
				}
				else
				{
					leftFront.Set(0);
//.........这里部分代码省略.........
开发者ID:secant,项目名称:robot2014,代码行数:101,代码来源:easyAutonomousTesting.cpp

示例7: Autonomous

	/****** AUTO FUNCTIONS END *******/
	void Autonomous()
	{
		int counter=0;
		int autonomousEngagement = 0;
		DriverStationLCD *screen = DriverStationLCD::GetInstance();	
		compressor.Start(); //starts compressor class
		rightArmSolenoid.Set(DoubleSolenoid::kReverse); //brings the arms down
		leftArmSolenoid.Set(DoubleSolenoid::kReverse);
		/*** ENSURES THE CATAPULT IS LOADED AND LOADS IF UNLOADED ***/
		if (leftLimitSwitch.Get() == 1 && rightLimitSwitch.Get() == 1)
		{
			winchMotor.Set(0.1); // Gears need to be moving slowly to allow the dog gear to engage properly
			dogSolenoid.Set(DoubleSolenoid::kForward); // Pushes the pneumatic piston forward to engage the dog gear
			Wait(0.2); // Giving the pistons time to engage properly
			winchMotor.Set(0); // Now that the dog gear is engaged, the gears do not have to move
			ratchetSolenoid.Set(DoubleSolenoid::kForward); // Pushes the pneumatic piston forward to engage the ratchet
			Wait(0.2); // Giving the pistons time to engage properly
		}
		while (leftLimitSwitch.Get() == 1 && rightLimitSwitch.Get() == 1) // If Limit Switch Buttons are not pressed
			{
			winchMotor.Set(1); //Now starts the winch motor to load the catapult
			}
		// If the Catapult Left &  Limit Switches are (0,0), (0,1), (1,0)
		{
			winchMotor.Set(0); // Stops the Winch Motor since one or more buttons are pressed
			if ((dogSolenoid.Get() == DoubleSolenoid::kReverse) && (ratchetSolenoid.Get() == DoubleSolenoid::kForward)) // If the Dog Gear is disengaged but the ratchet is engaged
				{
					winchMotor.Set(0.05); // Gears need to be moving slowly to allow the dog gear to engage properly. Might want to test this since the catapult's already loaded.
					dogSolenoid.Set(DoubleSolenoid::kForward); // Engages the dog gear so both dog gear and ratchet are engaged before shooting for safety
					Wait(0.1); // Giving the pistons time to engage properly
					winchMotor.Set(0); // Now that the dog gear is engaged, the gears do not have to move
				}
			else if ((dogSolenoid.Get() == DoubleSolenoid::kForward) && (ratchetSolenoid.Get() == DoubleSolenoid::kReverse)) // If the dog gear is engaged but the ratchet is disengaged
				{
					ratchetSolenoid.Set(DoubleSolenoid::kForward); // Engages the ratchet so that both dog gear and ratchet are engaged before shooting for safety
					Wait(0.1); // Giving the pistons time to engage properly
				}
		}
		/*** DONE LOADING THE CATAPULT ***/
		float pLower = 5; // min height of rectangle for comparison
		float pUpper = 15;	// max height of rectangle for comparison
		int criteriaCount = 1; // number of elements to include/exclude at a time
		int rejectMatches = 1;	// when set to true, particles that do not meet the criteria are discarded
		int connectivity = 1;	// declares connectivity value as 1; so corners are not ignored
		int filterFunction;	// removes small blobs
		int borderSetting;	// variable to store border settings, limit for rectangle
		int borderSize = 1;  // border for the camera frame (if you don't put this, DriverStation gets mad at you)
		ParticleFilterCriteria2 particleCriteria;	
		ParticleFilterOptions2 particleFilterOptions;
		int numParticles;
		particleCriteria.parameter = IMAQ_MT_BOUNDING_RECT_HEIGHT; //The Morphological measurement we use
		particleCriteria.lower = pLower; // The lower bound of the criteria range
		particleCriteria.upper = pUpper; // The upper bound of the criteria range
		particleCriteria.calibrated = FALSE; // We aren't calibrating to real world measurements. We don't need this.
		particleCriteria.exclude = TRUE; // Remove all particles that aren't in specific pLower and pUpper range
		particleFilterOptions.rejectMatches = rejectMatches; // Set to 1 above, so images that do not meet the criteria are discarded
		particleFilterOptions.rejectBorder = 0; // Set to 0 over here so border images are not discarded
		particleFilterOptions.connectivity8 = connectivity; // Sets the image image to 8 bit
		while ((IsAutonomous()))
		{
			if (logitech.GetRawButton(4))
				{
					autonomousEngagement = 1;
				}
			if (autonomousEngagement == 0) // If real autonomous is not engaged start
			{
				if (logitech.GetRawButton(1))
					{
						driveForward();
					}
				if (logitech.GetRawButton(9))
				{
					dogSolenoid.Set(DoubleSolenoid::kForward);		// Brings the pneumatic piston backward to raise the retrieval arm
					winchMotor.Set(0.1);
					Wait(0.3);
					ratchetSolenoid.Set(DoubleSolenoid::kForward);	// Pushes the pneumatic piston forward to lower the retrieval arm
					while(leftLimitSwitch.Get()==1 && rightLimitSwitch.Get()==1)
						{
							winchMotor.Set(1);
						}
				}
				if (logitech.GetRawButton(2))
				{
					autonomousCatapultRelease();
				}
				if (logitech.GetRawButton(3))
				{
					stopDriving();
				}
				if (logitech.GetRawButton(5))
				{
					turnLeft();
				}
				if (logitech.GetRawButton(7))
				{
					turnLeftMore();
				}
				if (logitech.GetRawButton(6))
				{
//.........这里部分代码省略.........
开发者ID:secant,项目名称:robot2014,代码行数:101,代码来源:easyAutonomousTesting.cpp


注:本文中的DoubleSolenoid::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。