Interface OpMode

All Known Implementing Classes:
PeriodicOpMode

public interface OpMode
Top-level interface for opmode classes. Users should generally extend one of the abstract implementations of this interface (e.g. PeriodicOpMode) rather than directly implementing this interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    This function is called periodically while the opmode is selected on the DS (robot is disabled).
    void
    This function is called when the opmode is no longer selected on the DS or after opModeRun() returns.
    void
    opModeRun(long opModeId)
    This function is called when the opmode starts (robot is enabled).
    void
    This function is called asynchronously when the robot is disabled, to request the opmode return from opModeRun().
  • Method Details

    • disabledPeriodic

      default void disabledPeriodic()
      This function is called periodically while the opmode is selected on the DS (robot is disabled). Code that should only run once when the opmode is selected should go in the opmode constructor.
    • opModeRun

      void opModeRun(long opModeId) throws InterruptedException
      This function is called when the opmode starts (robot is enabled).
      Parameters:
      opModeId - opmode unique ID
      Throws:
      InterruptedException - when interrupted
    • opModeStop

      void opModeStop()
      This function is called asynchronously when the robot is disabled, to request the opmode return from opModeRun().
    • opModeClose

      void opModeClose()
      This function is called when the opmode is no longer selected on the DS or after opModeRun() returns. The object will not be reused after this is called.