Limit switch code help

I am programming a code for a catapult arm so that when it hits the limit switch, the motor of the arm goes into hold mode. Everything in this code works fine except that the limit switch being pressed is not detected at all.

There isn’t a while loop to keep checking if pressing is true. It would run through the whole void 1 time 1 ms after your catapult void is started.

Instead of pressing, we did limitswitchE.pressed(stopcatavoid) before our main driver control while loop.

1 Like