Simulating code causes a bunch of errors

im new to programming and when ever i go to simulate my code i get a bunch of errors and it closes the gui immediately after it opens i attached a image of the errors below that i get hopefully yall could help me with this

that doesn’t look like a simulation specific error, just that you’re initializing multiple PWM or DIO objects on the same port. wpilib automatically throws an error if you try to initialize 2 devices on the same port

Your Intake subsystem has its own copy of the LEDs subsystem. Don’t do this. Subsystems should only be created and stored by the RobotContainer

2 Likes

THANK YOU it worked!!!

1 Like

I feel like I encounter accidental recreation of subsystems more often than I actually need to create the same subsystem twice. I wonder if it would be worth adding a check to the SubsystemBase constructor that there isn’t already a subsystem with the same name. This would force developers creating multiple copies of a subsystem to make an explicit call to super(name), which is fine because I’m sure they were going to name them anyway.

1 Like