My question #1, the RX line. Can I run the script below with a pulse of voltage to the RX terminal? I am going to start and activate the controller with a radio that puts out a 500ms pulse of 6-8 volts DC. I can replace the switch I am using to test with with a relay and take the pulse from my radio to switch a relay (mechanical device to fail sometime). Or can I put a voltage divider in between my radio and the RX line to use 500ms pulse of 3-4 volts to replace my switch and run the script through the RX line?
#2
7000 2 servo
350 delay
0 2 servo
In the code above
(7000 2 servo) is the command to give channel 2 pulses move servo 2 to position 1750?
(350 delay) is to send the pulses for 350 ms
(0 2 sevo) is to stop sending pulses to channel 2
Am I understanding this correctly?
Thanks
Bobby
# Uses WAIT_FOR_BUTTON_PRESS to allow a user to step through a sequence
# of positions on servo 2,3,4,5
begin
wait_for_button_press
7000 2 servo
350 delay
0 2 servo
wait_for_button_press
7000 3 servo
350 delay
0 3 servo
wait_for_button_press
7000 4 servo
350 delay
0 4 servo
wait_for_button_press
7000 5 servo
350 delay
0 5 servo
repeat
# Returns 1 if the button is pressed, 0 otherwise.
sub button
1 get_position 500 less_than
return
# Waits for a button press, with debouncing.
# (Requires the BUTTON subroutine.)
sub wait_for_button_press
wait_for_button_open_10ms
wait_for_button_closed_10ms
return
# wait for the button to be NOT pressed for at least 10 ms
sub wait_for_button_open_10ms
get_ms # put the current time on the stack
begin
# reset the time on the stack if it is pressed
button
if
drop get_ms
else
get_ms over minus 10 greater_than
if drop return endif
endif
repeat
# wait for the button to be pressed for at least 10 ms
sub wait_for_button_closed_10ms
get_ms
begin
# reset the time on the stack if it is pressed
button
if
get_ms over minus 10 greater_than
if drop return endif
else
drop get_ms
endif
repeat