Quote:
Originally Posted by Wildcats1378
I am writing a piece of code for our shooter that will continue moving a motor until it hits a certain limit switch, and then continues onto the next frame...
How might this be accomplished?
|
You mentioned a flat sequence, so I assume you're using LabVIEW.
Just put a while loop in the frame, reading the limit switch inside the loop and using the returned value as the termination condition for the loop. It'll keep looping until the switch is activated. Be sure to also put a 10 ms delay (or thereabouts) inside the loop so it doesn't use up all the CPU cycles just waiting for the switch.
Quote:
Originally Posted by virtuald
I would recommend hooking the limit switch up to the Jaguar, so it automatically turns itself off. No code required.
|
In this case, code is definitely required. This is a sequence of events that waits at one step until the switch is hit, so the program needs to be reading the switch.