Go to Post There is a very fine line between passion and emotion, sometime it gets crossed. Let's not confuse the two. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Spotlight this post!  
Unread Today, 14:53
charlier999's Avatar
charlier999 charlier999 is offline
Registered User
FRC #1662 (Raptor Force Engineering)
Team Role: Programmer
 
Join Date: Feb 2017
Rookie Year: 2013
Location: Lodi, CA
Posts: 19
charlier999 is an unknown quantity at this point
Re: Pneumatics code problems.

Code:
#includes stuff

class Robot: public frc::IterativeRobot
{
public:

bool shifter_varable = false; //shifter_varable = wasAPressed

DoubleSolenoid *shifter;

// other random decoration of other varables non 
// robotInit, teleopInit, autonomousInit, autonomousPeriodic, etc

 void teleopPeriodic() {

if (driver->GetRawButton(2)){

  if (!shifter_varable){ // shifter_varable = wasAPressed

    shifter_varable = true;

    shifter->Set(shifter->Get() == 

DoubleSolenoid::Value::kReverse ?
DoubleSolenoid::Value::kForward :
DoubleSolenoid::Value::kReverse);

}else{

  shifter_varable = false;

  }
}
I copied your code and replaced wasAPressed to shifter_varable and.... it still did the same thing. I think the Rio hates me
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi