DS Code Light Turns Red

Hello everyone. Apologies if this question has already been asked, but I haven’t been able to find any information that seems relevant to this problem. I wrote up some code recently and me and the other programmer on the team went to test autonomous and the sendable choosers. But whenever we enable autonomous the code light in the Driver Station turns red, the robot is disabled, and then the code light turns green again. I’ve found that this problem goes away when a significant portion of auto is commented out, but it doesn’t seem to matter which part is removed.

Here is a link to the github:https://github.com/MadScot0/2018-Robot-Code/blob/master/Robot.java

Thanks for any help.

That usually happens when an exception is thrown. In most cases it’s a NullPointerException when trying to call a method on an object before it’s been created. The exceptions and stack trace should appear in the driverstation program or riolog (which you can see in Eclipse).

There are also a few classes you’re using but aren’t imported or present in your GitHub repository, which makes it hard to tell if those could be causing the crash.

Sorry, it turns out that this wasn’t a software issue. We had loaded this code onto our practice electronics board to test somethings. We had some references to the NavX board but didn’t actually have a NavX board plugged in on this board. Thanks for the help.