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


C++ Solenoid类代码示例

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


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

示例1: 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

示例2: TestInit

    /**
     * Initialization code for test mode should go here.
     * 
     * Use this method for initialization code which will be called each time
     * the robot enters test mode.
     */
    void TestInit()
    {
printf(">>> TestInit\n");
#ifdef HAVE_COMPRESSOR
	compressor->Start();
#endif
#ifdef HAVE_ARM
	arm->Set(DoubleSolenoid::kOff);
#endif
#ifdef HAVE_INJECTOR
	injectorL->Set(DoubleSolenoid::kOff);
	injectorR->Set(DoubleSolenoid::kOff);
#endif
#ifdef HAVE_EJECTOR
	ejector->Set(false);
#endif
#ifdef HAVE_LEGS
	legs->Set(false);
#endif

#ifdef HAVE_TOP_WHEEL
#ifdef HAVE_TOP_CAN1
	jagVbus(topWheel1, 0.0);
#endif
#ifdef HAVE_TOP_PWM1
	topWheel1->Set(0.0);
#endif
#ifdef HAVE_TOP_CAN2
	jagVbus(topWheel2, 0.0);
#endif
#endif
#ifdef HAVE_BOTTOM_WHEEL
#ifdef HAVE_BOTTOM_CAN1
	jagVbus(bottomWheel1, 0.0);
#endif
#ifdef HAVE_BOTTOM_PWM1
	bottomWheel1->Set(0.0);
#endif
#ifdef HAVE_BOTTOM_CAN2
	jagVbus(bottomWheel2, 0.0);
#endif
#endif
printf("<<< TestInit\n");
    }
开发者ID:errorcodexero,项目名称:k9,代码行数:50,代码来源:k9.cpp

示例3: TeleopInit

    /**
     * Initialization code for teleop mode should go here.
     * 
     * Use this method for initialization code which will be called each time
     * the robot enters teleop mode.
     */
    void TeleopInit()
    {
printf(">>> TeleopInit\n");
#ifdef HAVE_COMPRESSOR
	compressor->Start();
#endif
#ifdef HAVE_ARM
	arm->Set(DoubleSolenoid::kForward);
#endif
#ifdef HAVE_INJECTOR
	injectorL->Set(DoubleSolenoid::kReverse);
	injectorR->Set(DoubleSolenoid::kReverse);
#endif
#ifdef HAVE_EJECTOR
	ejector->Set(false);
#endif
#ifdef HAVE_LEGS
	// legs->Set(true);
#endif

	// StartWheels();
printf("<<< TeleopInit\n");
    }
开发者ID:errorcodexero,项目名称:k9,代码行数:29,代码来源:k9.cpp

示例4: solenoid_diag_handler

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

示例5: TestBGrabber

	void TestBGrabber()
		{
			//ROLLERS	
			if (m_operator->GetRawAxis(TRIGGERS) > 0.4) {
				m_roller->Set(0.5);
			}
			else if (m_operator->GetRawAxis(TRIGGERS) < -0.4)
				m_roller->Set(0.5);
			else {
				m_roller->Set(0.0);
			}	

			//BALL CATCH (#Sweg)
			if (m_operator->GetRawButton(BUTTON_A)) {
				m_catch->Set(true); 
			}
			else if (m_operator->GetRawButton(BUTTON_B)) {
				m_catch->Set(false);
			}

			//bArm OPEN / CLOSE
			if (m_operator->GetRawButton(BUTTON_X)) {
				m_bArm->Set(true);
			}
			else if (m_operator->GetRawButton(BUTTON_Y)) {
				m_bArm->Set(false);
			}
		}
开发者ID:hal7df,项目名称:further-suggestions,代码行数:28,代码来源:BuiltinDefaultCode.cpp

示例6: OperatorControl

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		
		GetWatchdog().SetEnabled(true);
		compressor->Start();
		
		GetWatchdog().SetExpiration(0.5);
		
		bool valve_state = false;
		
		while (IsOperatorControl())
		{
			motor->Set(stick->GetY());
			
			if (stick->GetRawButton(1) && !valve_state)
			{
				valve->Set(true);
				valve_state = true;
			}
			
			if (!stick->GetRawButton(1) && valve_state)
			{
				valve->Set(false);
				valve_state = false;
			}
			// Update driver station
			//dds->sendIOPortData(valve);

			GetWatchdog().Feed();
		}
	}
开发者ID:FRC2994,项目名称:FRC2994,代码行数:34,代码来源:MyRobot.cpp

示例7: 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

示例8: RobotInit

	void RobotInit(void) {
		// Actions which would be performed once (and only once) upon initialization of the
		// robot would be put here.
		shiftLeft->Set(false); //low gear
		shiftRight->Set(false); //low gear
		passingPiston->Set(false); //retracted
		printf("RobotInit() completed.\n");
	}
开发者ID:jkirlans5282,项目名称:2014_Robot_Code-1,代码行数:8,代码来源:BuiltinDefaultCode.cpp

示例9: deployMini

	void RawControl::deployMini()
	{
		if(chkSwitch())
		{
			deploy->Set(true);
		}
		else
			deploy->Set(false);
	}
开发者ID:The-Charge,项目名称:2011_TubeBot,代码行数:9,代码来源:TubeBot.cpp

示例10: 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

示例11: 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

示例12: OperatorControl

	void OperatorControl()
	{
		compressor.Start();
		while (IsOperatorControl())
		{
			if(stick.GetRawButton(6)) //press the upper right trigger
			{
				piston.Set(true);
			}
			else if(stick.GetRawButton(8)) //press the lower right trigger
			{
				piston.Set(false);
			}
		}
		compressor.Stop();
	}
开发者ID:mililanirobotics,项目名称:FRC2015,代码行数:16,代码来源:Robot.cpp

示例13: TeleopInit

	void TeleopInit() override {
		drive->SetExpiration(200000);
		drive->SetSafetyEnabled(false);
		liftdown->Set(false);

		intake_hold = false;
		lastLiftPos = 0;
		manual = true;
	}
开发者ID:RoboLoCo-5338,项目名称:BasicDrive,代码行数:9,代码来源:Robot.cpp

示例14: AutonomousInit

	// Start auto mode
	void AutonomousInit() override {
		autoSelected = *((int*) chooser.GetSelected()); // autonomous mode chosen in dashboard
		currentState = 1;
		ahrs->ZeroYaw();
		ahrs->GetFusedHeading();
		autoLength = SmartDashboard::GetNumber(AUTO_LENGTH, AUTO_LENGTH_DEFAULT);
		autoSpeed = SmartDashboard::GetNumber(AUTO_SPEED, AUTO_SPEED_DEFAULT);
		autoIntakeSpeed = SmartDashboard::GetNumber(AUTO_INTAKE_SPEED, AUTO_INTAKE_SPEED_DEFAULT);
		liftdown->Set(false);
	}
开发者ID:RoboLoCo-5338,项目名称:BasicDrive,代码行数:11,代码来源:Robot.cpp

示例15: 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


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