isFwdLimitSwitchClosed and isRevLimitSwitchClosed methods

Are there equivalents of these methods in the TalonSRX class? I can’t seem to find them. Our library uses these methods and we need to know what methods replace them.

We haven’t tried using it, but looking through the library docs it seems like the limit switch handling is now part of the Faults API.

The Java docs are here; C++ here.

A Java snippet using the API would be something like the below; C++ would be similar:


...
    	Faults f = new Faults();
    	myTalonSRX.getFaults(f);
    	if (f.ForwardLimitSwitch) {
    		// limit switch is closed
    	}
...

Hope that helps!

  • Ron

Go here…
https://github.com/CrossTheRoadElec/Phoenix-Documentation/blob/master/Migration%20Guide.md
… then search for “isFwdLimitSwitchClosed”

Ron’s example works too assuming limit switch features are enabled. In other words the fault flags tell you when the motor is being limited (neutral) due to limit switch logic.