04-02-2012 04:33 PM
Hi iam trying to implement a limitswitch to stop my stepper motor when it hits the edge of the wall. I first set the stepper motor to run a certain number of steps but when i read a high voltage of the limit switch it does not stop from the number of steps already taken. Iam not sure how to tell the stepper motor to stop as soon as the limit switch is triggered. My sample vi home works but it forces me to put the stepper motor function in a while loop.
04-03-2012 12:13 PM
I didn't write the stepper portion of the toolkit, but I don't think this functionality is built into the Arduino Stepper API.
I think the way the stepper library works is that you tell it a number of steps and forget about it. There is no built in way to cancel the current action.
The LIFA Stepper support is built on the AccelStepper library, so I'd start there to se if there is a way to stop the current action.
-Sam K
04-04-2012 08:30 AM
Sam is correct.
This functionality is not built into the toolkit but is exposed in the AccelStepper library so you will have to expose some extra functionality from the library to get that behavior.