001package com.ctre.phoenix.motorcontrol; 002 003/** 004 * Choose the invert type of the motor controller. 005 * None is the equivalent of SetInverted(false), where positive request yields positive voltage on M+. 006 * InvertMotorOutput is the equivelant of SetInverted(true), where positive request yields positive voltage on M-. 007 * FollowMaster/OpposeMaster will match/oppose a master Talon/Victor. This requires device to be configured as a follower. 008 */ 009public enum TalonFXInvertType { 010 /** Same as SetInverted(false) */ 011 CounterClockwise(0), 012 /** Same as SetInverted(true) */ 013 Clockwise(1), 014 /** Follow the invert of the master this MC is following */ 015 FollowMaster(2), 016 /** Oppose the invert of the master this MC is following */ 017 OpposeMaster(3); 018 019 /** 020 * Value of Invert Type 021 */ 022 public int value; 023 /** 024 * Create TalonFXInvertType of specified value 025 * @param value Value of Invert Type 026 */ 027 TalonFXInvertType(int value) 028 { 029 this.value = value; 030 } 031 032 /** 033 * Helper method to convert to generic InvertType enum. 034 * @return value cast as InvertType 035 */ 036 public InvertType toInvertType(){ 037 switch(value){ 038 case 0: return InvertType.None; 039 case 1: return InvertType.InvertMotorOutput; 040 case 2: return InvertType.FollowMaster; 041 case 3: return InvertType.OpposeMaster; 042 default: return InvertType.None; 043 } 044 } 045};