Class ButtonMonitor

java.lang.Object
com.ctre.phoenix.ButtonMonitor
All Implemented Interfaces:
ILoopable

public class ButtonMonitor extends Object implements ILoopable
Class to handle button events
  • Constructor Details

    • ButtonMonitor

      public ButtonMonitor(edu.wpi.first.wpilibj.GenericHID controller, int buttonIndex, ButtonMonitor.IButtonPressEventHandler ButtonPressEventHandler)
      Constructor for ButtonMonitor
      Parameters:
      controller - Controller to monitor
      buttonIndex - Button to monitor
      ButtonPressEventHandler - Class that will handle buttonPresses
  • Method Details

    • process

      public void process()
      Call this every loop, it monitors for button presses
    • onStart

      public void onStart()
      Do nothing on start
      Specified by:
      onStart in interface ILoopable
    • onLoop

      public void onLoop()
      Process every loop
      Specified by:
      onLoop in interface ILoopable
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface ILoopable
      Returns:
      false, this is never done
    • onStop

      public void onStop()
      Do nothing on stop
      Specified by:
      onStop in interface ILoopable