How to code a limit switch to a catapult

What a pleasant coincidence!
image