My catapult is firing non-stop when I first enter the code but when I exit it doesn't anybody know why?

Hey. I’m having problems as stated in the topic does anybody know why this might be occurring and if so, how I can fix that?

Without seeing your code, this is difficult to diagnose, but it might have to do with preconditional variables, if you’re not resetting them. It could be that shutting off the brain sets them all differently than just starting the program will. Again, seeing your code would help to make the issue evident. I’m also somewhat unsure of the question. I assume you mean that it fires the first time you run your code when you turn the brain on, but when you exit and run the code after that it isn’t. Please provide more detail so we can help you!

2 Likes

Yes.

ALWAYS define ALL your variables immediately and set them to an initial value (usually zero). If not set to a defined value… they are undefined and bad things can happen.

Another tip might be to put a small (1/10 second) delay in the code to give time for startup items to process/run.