Code crashes as soon as I deploy it

This is what I have in Robot.java. I’ve done this before and never had an issue with it.
Thanks for the tip, as well.
Screenshot 2023-09-14 175727

All of those variables need to be initialized somewhere, they default to null in Java unless they are initialized (with army = new army() etc). Either inline in those lines or in robotInit().

Okay, thank you. I will see if that works.

You should declare the subsystems final. This way the code will not build if you haven’t initialized them.

Like so

final army army = new army();

But for all the subsystems

1 Like