View Single Post
  #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