Expansion lockout?v

Hello forumers,
I was thinking of making a bit of code that doesn’t allow the expansion button to be pressed until the last 10 seconds. (to remove accidental deployment) When I was experimenting with this idea, I originally tried a wait (95, seconds) in driver control, but realized that that will just call the wait every time the driver loop repeats.
What would be the best way of going about this?

Thanks in advance,
Henry 344E

1 Like

Early on we tried something like this by making a boolean variable and marking it true if the brain time was >95 seconds. Then end game would only launch if the endgame button was pressed and the bool was true.

But we read field control problems could cause the brain timer to potentially reset in the middle of a match so we changed to a 2 button combo to prevent accidental firings. So button down and y have to both be pressing to launch.

1 Like

To avoid anything too complicated my team used a safety button that had to be pressed before the actual expansion button would work with just a variable and an if statement in the deployment code.
I believe there’s also a way to reset the robot’s timer so you could try doing using that the first time the driver loop is called with, likely with a variable that adds to itself when the driver loop is called and only works when it is at 0.

I like this solution a lot! Simple to understand and execute, kind of like a safety cap over a very dangerous button… like EMERGENCY POWER OFF :slight_smile: (I am still traumatized when an undergraduate student in our lab ask “what does EPO button do?” sticking his finger into housing and shutting off all the power to all computers, machine rooms, all outlets, … ugh

1 Like

Thanks everyone for all the advice! I’ll try this out when I have the bot tomorrow and I’ll get back to y’all. :v: