Determining if match is active

Hi All - I want to conditionalize which of two limit switches stops a motor based on whether there’s an active match in progress or not. That is, switch A is used during matches, switch B is used between matches.

My thought was to use the DriverStation isFMSAttached() method; but wasn’t sure that was it alone; or whether isEnabled() or other isFoo() driver station methods fits into this some how.

Any thoughts?

What’s your use case for this? If you want to know whether or not you’re in an official match, then yes, use DriverStation’s isFMSAttached(), but there is likely a cleaner and more reliable solution, such as toggling some switch on the dashboard. Using isEnabled() will tell you whether your robot is enabled, regardless of whether it’s on the field, in the pit or back at your shop.

I like your idea of some dashboard variable. Will look into that.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.