What I believe I am trying to accomplish is setting it outside of the loop. So basically store a variable and set it to that variable later.
Initial Decleration of flipperset (unsure if that will work)
Code:
Relay::Value flipperset;
sets flipperset to shut the relay off
Code:
flipperset = Relay::kOff;
If statements to change the flipperset variable
Code:
if (m_leftStick->GetRawButton(5) == 1 && flipperdoorright->Get() == 0 ) {
flipperset = Relay::kForward;
} else if (m_leftStick->GetRawButton(4) == 1 && flipperdoorleft->Get() == 0 ){
flipperset = Relay::kReverse;
} else if (flipperdoorleft->Get() == 1 || flipperdoorright->Get() == 1) {
flipperset = Relay::kOff;
}
Final set of flipperdoor to a certain variable
Code:
flipperdoor->Set(flipperset);