Hello,
We have a AR-3606HB RC servo that programed to rotate at different speeds. But no command is running,
the motor keeps rotating at a very low speed. We are looking for a way to completely stop the rotation when we don’t use the set up.
Bellow is the program we use for this purpose. We really appreciate if any one can help us to correct the codes of our program to stop moving the motor.
Thank you!
[code]# When the script is not doing anything else,
this loop will listen for button presses. When a button
is pressed it runs the corresponding sequence.
begin
button_go
if
button_up
if
button_very
if
button_fast
if
sequence_veryfast
else
sequence_veryslow
endif
else
button_fast
if
sequence_fast
else
sequence_slow
endif
endif
else
sequence_down
endif
else
sequence_stop
endif
repeat
These subroutines each return 1 if the corresponding
button is pressed, and return 0 otherwise.
These channels must be configured as Inputs in the
Channel Settings tab.
#for RC servo, 8000 is full speed, 6000 is stop, below 6000 is backwards, maybe 4000 is full speed backwards
sub button_very
1 get_position 100 greater_than
return
sub button_fast
2 get_position 100 greater_than
return
sub button_up
3 get_position 100 greater_than
return
sub button_go
4 get_position 100 less_than
return
These subroutines each perform servo movements
sub sequence_veryfast
8000 0 servo
return
sub sequence_veryslow
6238 0 servo
return
sub sequence_fast
6943 0 servo
return
sub sequence_slow
6453 0 servo
return
sub sequence_down
5827 0 servo
return
sub sequence_stop
6000 0 servo
return[/code]