Hello,
I am trying to trigger the subroutine ‘fire’ when a switch is pressed down (and causes its target to equal 0)
The stack overflows nearly instantly resulting in an error, usually 0x0080 and sometimes 0x0040
I have tried using the example script for using inputs from the site but all of them spit out errors,
Here is the script i’ve tried throwing together, I am sort of new to coding this kinda of thing,
# Uses WAIT_FOR_BUTTON_PRESS to allow a user to step through a sequence
# of positions on servo 0.
sub button_push
if 0 servo equals 0 fire
#0 get_position 0
#if 0 fire
endif 0
return
sub fire
begin
5000 1 servo
500 delay
5000 2 servo
500 delay
5000 3 servo
500 delay
7000 1 servo
500 delay
7000 2 servo
500 delay
7000 3 servo
500 delay
repeat
Thanks alot, any help is appreciated