I’m helping a friend write a script to implement a limit switch for controlling a continuously rotating servo on a meastro 24. I’m a novice to the meastor and having a problem with the script structure. I’m using the fallowing code;
-
-
2_Bird_House # sequence built via the control center
3 4 acceleration # set the acceleration parameter for servo 4
10 4 speed # set speed parameter for servo 4
2000 4 servo # start the servo
wrench_lower_limit_pulse # sub for detecting the limit switch activation
while
500 delay # only want to check the limit switch status every 500 msec
repeat
0000 4 servo # stop the servo after limit switch is detected
4_worker # sequence built via the control center
_
_
sub wrench_lower_limit_pulse # returns 0 if no pulse detected & 1 if pulse detected
17 get_position 500 less_than # channel 17 has a pullup resister on it copy of example sub
return
The compiler complains that the stack is empty. If I comment out the while loop everything is OK. I’m entering this query on a Mac and do not have the code listing available - but above is a accurate copy of it. I think wrench_lower_limit_pulse seeds the while loop but apparently this is not the case. Any help would be greatly appreciated