Hi,
I have not found solution for my problem. What I want to do:
Channel 0 - input (switch “a”)
Channel 1 - servo
Channel 2 - input (switch “b”)
Channel 3 - servo
Switch “a” move servo from position A to B and return to B
Switch “b” move serwo from position A to B and stay in this position (second press of switch “b” will move servo back to A position)
My problem is that after press “b” button, switch “a” is no longer working. Switch “a” works until switch “b” is press. I noticed that this red triangle which is scanning code after press switch “b” is no longer scanning subroutine for button “a”.
Here is my code for now:
begin
button_a if sequence_a endif
button_b if sequence_b endif
repeat
sub button_a
0 get_position 500 less_than
return
sub button_b
2 get_position 500 less_than
return
sub wait_for_button_b_press
wait_for_button_b_open_10ms
wait_for_button_b_closed_10ms
return
sub wait_for_button_b_open_10ms
get_ms
begin
button_b
if
drop get_ms
else
get_ms over minus 10 greater_than
if drop return endif
endif
repeat
sub wait_for_button_b_closed_10ms
get_ms
begin
button_b
if
get_ms over minus 10 greater_than
if drop return endif
else
drop get_ms
endif
repeat
sub sequence_a
1000 delay
4000 1 servo 900 delay
8000 1 servo 900 delay
return
sub sequence_b
begin
4000 frame
5000 frame
repeat
sub frame
wait_for_button_b_press
3 servo
return
Maybe there is simpler method to do this what I want ? Most of channels I want to set to move A > B > A but one of it I want to be A > B stay > press > A stay etc.
Thanks for help