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


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

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


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

示例1: DriverLCD

void RobotDemo::DriverLCD()
{
	if (cycle_counter >= 50)
	{
		dsLCD->Printf(DriverStationLCD::kUser_Line1, 1, "RPS Back:%f  ",
				RPS_back);
		dsLCD->Printf(DriverStationLCD::kUser_Line2, 1, "RPS Front:%f  ",
				RPS_front);
		dsLCD->Printf(DriverStationLCD::kUser_Line3, 1, "RPS DRPS:%f  ",
				desired_RPS_control);
#if 0
		if (shooter_fire_piston_A->Get())
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line4, 1,"Fire   ");
		}
		else
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line4, 1,"Retracting...   ");
		}
#endif
		//dsLCD->Printf(DriverStationLCD::kUser_Line4, 1,"TopLS:%i   BotLS:%i   ", top_claw_limit_switch->Get(),
		//	bottom_claw_limit_switch ->Get());
		if (top_claw_limit_switch->Get())
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line4, 1, "!TOP");
		}
		else if (!bottom_claw_limit_switch->Get())
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line4, 1, "!BOTTOM");
		}
		else
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line4, 1, "Neither");
		}
		if (shooter_angle_1->Get())
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line5, 1, "Up   ");
		}
		else
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line5, 1, "Down   ");
		}
		if (arcadedrive)
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line6, 1, "Arcade   ");
		}
		else
		{
			dsLCD->Printf(DriverStationLCD::kUser_Line6, 1, "Tank   ");
		}
		dsLCD->UpdateLCD();
		//cycle_counter = 0;
	}
	//cycle_counter++;
}
开发者ID:2643,项目名称:2013-Code,代码行数:55,代码来源:final-2013botcode_03-18-13.cpp

示例2: GetSolenoid

/**
 * Read the current value of the solenoid.
 *
 * @param channel The channel in the Solenoid module
 * @return The current value of the solenoid.
 */
bool GetSolenoid(UINT32 channel)
{
	Solenoid *s = allocateSolenoid(channel);
	if (s == NULL)
		return false;
	return s->Get();
}
开发者ID:FRC980,项目名称:FRC-Team-980,代码行数:13,代码来源:CSolenoid.cpp

示例3: ShiftLow

	void ShiftLow(void) 
	{
		// shiftRight->Get() : false is low gear, true is high gear
		if(shiftRight->Get()) {
			shiftRight->Set(false);
			shiftLeft->Set(false);
		}
	}
开发者ID:jkirlans5282,项目名称:2014_Robot_Code-1,代码行数:8,代码来源:BuiltinDefaultCode.cpp

示例4: ShiftHigh

	void ShiftHigh(void) 
	{
		// shiftRight->Get() : false is low gear, true is high gear
		if(!(shiftRight->Get())) 
		{
			shiftRight->Set(true);
			shiftLeft->Set(true);
		}
	}
开发者ID:jkirlans5282,项目名称:2014_Robot_Code-1,代码行数:9,代码来源:BuiltinDefaultCode.cpp

示例5: Shoot

	void Shoot (bool teleop)
	{
		// code to differentiate teleop from autonomous
		/*if (teleop == true)
			shootyesorno = controller.GetRawButton(BTN_SHOOT);
		else if (teleop == false)
			shootyesorno = true;*/
		if (AcceptableToFire() == true && firefrisbee.Get() == true)
		{
			firefrisbee.Set(false); // SHOOT THE DARN FRISBEE
			shottime.Stop();
			shottime.Reset();
			shottime.Start();
		}
		if (shootyesorno == true && firefrisbee.Get() == false && AcceptableToFire() == true && ShootMode == eShoot)
		{
			firefrisbee.Set(true); // Primes that there frisbee
			shottime.Stop();
			shottime.Reset();
			shottime.Start();
		}
	}
开发者ID:Team537,项目名称:RobotCode,代码行数:22,代码来源:MyRobot.cpp

示例6: printfs

void RobotDemo::printfs()
{
	//printf("OUT LOOP\n");
	if (cycle_counter >= 70)
	{
		printf("RPS Back:%f   RPS Front:%f   %f    ", RPS_back, RPS_front,
				desired_RPS_control);
		printf("LS:%i %i   ", top_claw_limit_switch->Get(),
				bottom_claw_limit_switch->Get());
		//printf("Climb:%f   " , climbing_motor->Get());
		//printf("Shooters:%f   %f   ", shooter_motor_front ->Get(),
		//shooter_motor_back ->Get());

		if (shooter_angle_1->Get())
		{
			printf("Up   ");
		}
		else
		{
			printf("Down   ");
		}
		if (arcadedrive)
		{
			printf("Arcade   ");
		}
		else
		{
			printf("Tank   ");
		}
		printf("\n");

		cycle_counter = 0;
	}
	cycle_counter++;

}
开发者ID:2643,项目名称:2013-Code,代码行数:36,代码来源:final-2013botcode_03-18-13.cpp

示例7:

static nr::diag::handler_t
solenoid_diag_handler( const Solenoid& solenoid )
{ return solenoid.Get() ? "True" : "False"; }
开发者ID:alexbrinister,项目名称:Nashoba-Robotics2013-SimpleRobot,代码行数:3,代码来源:Robot.cpp

示例8: OperatorControl

	void OperatorControl(void)
	{
		autonomous = false;
		//myRobot.SetSafetyEnabled(false);
		//myRobot.SetInvertedMotor(kFrontLeftMotor, true);
		//	myRobot.SetInvertedMotor(3, true);
		//variables for great pid
		double rightSpeed,leftSpeed;
		float rightSP, leftSP, liftSP, lastLiftSP, gripSP, tempLeftSP, tempRightSP;
		float stickY[2];
		float stickYAbs[2];
		bool lightOn = false;
		AxisCamera &camera = AxisCamera::GetInstance();
		camera.WriteResolution(AxisCameraParams::kResolution_160x120);
		camera.WriteMaxFPS(5);
		camera.WriteBrightness(50);
		camera.WriteRotation(AxisCameraParams::kRotation_0);
		rightEncoder->Start();
		leftEncoder->Start();
		liftEncoder->Start();
		rightEncoder->Reset();
		leftEncoder->Reset();
		liftEncoder->Reset();
		bool fastest = false; //transmission mode
		float reduction = 1; //gear reduction from 
		bool bDrivePID = false;
		//float maxSpeed = 500;
		float liftPower = 0;
		float liftPos = -10;
		bool disengageBrake = false;
		int count = 0;
		//int popCount = 0;
		double popStart = 0;
		double popTime = 0;
		int popStage = 0;
		int liftCount = 0;
		int liftCount2 = 0;
		const float LOG17 = log(17.61093344);
		float liftPowerAbs = 0;
		float gripError = 0;
		float gripErrorAbs = 0;
		float gripPropMod = 0;
		float gripIntMod = 0;
		bool shiftHigh = false;
		leftEncoder->SetDistancePerPulse((6 * PI / 1000)/reduction); //6-inch wheels, 1000 raw counts per revolution,
		rightEncoder->SetDistancePerPulse((6 * PI / 1000)/reduction); //about 1:1 gear ratio
		DriverStationEnhancedIO &myEIO = driverStation->GetEnhancedIO();
		GetWatchdog().SetEnabled(true);
		GetWatchdog().SetExpiration(0.3);

		PIDDriveLeft->SetOutputRange(-1, 1);
		PIDDriveRight->SetOutputRange(-1, 1);
		//PIDDriveLeft->SetInputRange(-244,244);
		//PIDDriveRight->SetInputRange(-244,244);
		PIDDriveLeft->SetTolerance(5);
		PIDDriveRight->SetTolerance(5);
		PIDDriveLeft->SetContinuous(false);
		PIDDriveRight->SetContinuous(false);
		//PIDDriveLeft->Enable();
		//PIDDriveRight->Enable();
		PIDDriveRight->SetPID(DRIVEPROPGAIN, DRIVEINTGAIN, DRIVEDERIVGAIN);
		PIDDriveLeft->SetPID(DRIVEPROPGAIN, DRIVEINTGAIN, DRIVEDERIVGAIN);
		
		liftSP = 0;
		PIDLift->SetTolerance(10);
		PIDLift->SetContinuous(false);
		PIDLift->SetOutputRange(-0.75, 1.); //BUGBUG
		PIDLift->Enable();
		
		gripSP = 0;
		float goalGripSP = 0;
		bool useGoalSP = true;
		bool gripPIDOn = true;
		float gripP[10];
		float gripI[10];
		float gripD[10];
		PIDGrip->SetOutputRange(-0.5, 0.28); //Negative goes up
		PIDGrip->SetTolerance(5);
		PIDGrip->SetSetpoint(0);
		PIDGrip->Enable();
		miniDep->Set(miniDep->kForward);
		int i = 0;
		while(i < 10)
		{
			gripP[i] = GRIPPROPGAIN;
			i++;
		}
		i = 0;
		while(i < 10)
		{
			gripI[i] = GRIPINTGAIN;
			i++;
		}
		i = 0;
		while(i < 10)
		{
			gripD[i] = GRIPDERIVGAIN;
			i++;
		}

//.........这里部分代码省略.........
开发者ID:Skunk-ProLaptop,项目名称:Skunkworks1983,代码行数:101,代码来源:MyRobot+lift+36-tooth.cpp


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