|
Re: Reducing code complexity
Quote:
Originally Posted by Ziv
I suggest using the command-subsystem style
|
Implementing the command-subsystem paradigm using the base classes included in WPIlibJ also allows you to use event-driven programming using the Button classes, which can replace most - if not all - of your if statements with a couple lines at program initialization in the form:
Quote:
|
Originally Posted by http://www.wbrobotics.com/attachments/article/11/WPILibCookbook.pdf
Code:
JoystickButton trigger = new JoystickButton(stick, Joystick.ButtonType.kTrigger.value);
trigger.whenPressed(new DoCoolStuffCommand());
|
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
|