Skip to content

Reusable Utility Components

Max Krieger edited this page Dec 9, 2016 · 4 revisions

Here is a list of some very nice utility Components:

Name Functionality
DebouncingButton Want to toggle/activate something exactly once with a button? This class prevents the button from rapidly toggling back and forth while the button is held down. Just use the getToggle() method of your instance of DebouncingButton("MyControl1").
Time Time.Stopwatch comes in handy all the time for measuring time elapsed. Just make an instance, Time.Stopwatch.start();, and Time.Stopwatch.timeElapsed() // in milliseconds!
Name Functionality
Sequencer The definitive teleop macro-defining class, a Sequencer instance takes in an array of controllers and runs 'em one by one, then repeats. Pairs with the OnButtonPress subcontroller like lemonade and ice cream. Any instance can be cancelled/reset with the back button with an additional , true) arg, and it automatically sets macroBusy in the DriveSpeed static, giving macros precedence over joystick driving. Yummy!
Clone this wiki locally