Class TetrixMotorController

    • Field Detail

      • MOTOR_1

        public static final int MOTOR_1
        Represents Motor 1 as indicated on the controller
        See Also:
        Constant Field Values
      • MOTOR_2

        public static final int MOTOR_2
        Represents Motor 2 as indicated on the controller
        See Also:
        Constant Field Values
    • Method Detail

      • getBasicMotor

        public TetrixMotor getBasicMotor​(int motorID)
        Get a TetrixMotor instance that is associated with the motorID.
        Parameters:
        motorID - The motor ID number. This is indicated on the HiTechnic Motor Controller and is represented using MOTOR_1 or MOTOR_2.
        Returns:
        The TetrixMotor instance
        Throws:
        java.lang.IllegalArgumentException - if invalid motorID
        java.lang.UnsupportedOperationException - if motorID has already been used for a Tetrix motor instance other than TetrixMotor.
        See Also:
        TetrixMotor, getEncoderMotor(int), getRegulatedMotor(int)
      • getEncoderMotor

        public TetrixEncoderMotor getEncoderMotor​(int motorID)
        Get a TetrixEncoderMotor instance that is associated with the motorID. The motor must have an encoder installed for a TetrixEncoderMotor instance to work correctly.
        Parameters:
        motorID - The motor ID number. This is indicated on the HiTechnic Motor Controller and is represented using MOTOR_1 or MOTOR_2.
        Returns:
        The TetrixEncoderMotor instance
        Throws:
        java.lang.IllegalArgumentException - if invalid motorID
        java.lang.UnsupportedOperationException - if motorID has already been used for a Tetrix motor instance other than TetrixEncoderMotor.
        See Also:
        TetrixEncoderMotor, getBasicMotor(int), getRegulatedMotor(int)
      • getRegulatedMotor

        public TetrixRegulatedMotor getRegulatedMotor​(int motorID)
        Get a TetrixRegulatedMotor instance that is associated with the motorID. The motor must have an encoder installed for a TetrixRegulatedMotor instance to work correctly.
        Parameters:
        motorID - The motor ID number. This is indicated on the HiTechnic Motor Controller and is represented using MOTOR_1 or MOTOR_2.
        Returns:
        The TetrixRegulatedMotor instance
        Throws:
        java.lang.IllegalArgumentException - if invalid motorID
        java.lang.UnsupportedOperationException - if motorID has already been used for a Tetrix motor instance other than TetrixRegulatedMotor.
        See Also:
        TetrixRegulatedMotor, getBasicMotor(int), getEncoderMotor(int)
      • getVoltage

        public float getVoltage()
        Return the current battery voltage supplied to the controller.
        Returns:
        The current battery voltage in volts