Team2168 / 2015_Main_Robot

Source code for the 2015 season
2 stars 0 forks source link

Added methods to return whether the solenoids are engaged or disengaged #45

Closed Benmw99 closed 9 years ago

Benmw99 commented 9 years ago

Made methods in subsystems that say whether the pneumatics are engaged or not.

NotInControl commented 9 years ago

Ben good Job. This will work as written, however you can simplify the code even further. You don't need the if-else at all in these functions, you can simply write this

boolean isEngaged() { return gripper.get() == Value.kForward; }

since gripper.get() == Value.kForward is a conditional statement it returns true or false (remember when we covered that in class?)

And so, it will automatically return true, if true, and false otherwise. I would recommend updating the code to be streamlined in this way, although what you wrote is correct and would work as well.

NotInControl commented 9 years ago

once you update it, re push and I will merge it in.