jshenfield
New Member
I am currently having a go at making a remote controlled mount for an SA80. I have sorted the remote aspects of the program but need to have the servos communicate with it.
My intention is to have the remote move the servos in one direction by a certain amount when a button is pressed and the the other direction when another button is pressed. I think I have to use the registry to have the position of the servo in it, then have a sum to add 5 (or something) so the servo will look to that all the time then move accordingly. This is where I am a little lost. This is what I have so far but the servo just pulses when I press the button.
symbol try = w1
w2 = 75
main:
servo 4,75
irin [1000,main],C.0,b0 ;
if b0 = 1 then moveup
goto main
moveup:
let w1 = w2 + 5
write w1,w3
servopos 4,w3
pause 100
goto main
Thanks in advance
My intention is to have the remote move the servos in one direction by a certain amount when a button is pressed and the the other direction when another button is pressed. I think I have to use the registry to have the position of the servo in it, then have a sum to add 5 (or something) so the servo will look to that all the time then move accordingly. This is where I am a little lost. This is what I have so far but the servo just pulses when I press the button.
symbol try = w1
w2 = 75
main:
servo 4,75
irin [1000,main],C.0,b0 ;
if b0 = 1 then moveup
goto main
moveup:
let w1 = w2 + 5
write w1,w3
servopos 4,w3
pause 100
goto main
Thanks in advance