hello
i am currently making a remote control boat, and i am using a servo motor to control a rudder. obviously i want it to go left when i press left and right when i press right, and then return to the middle when i let go.
my problem though is that i can get the servo going one way but not the other.
im using the pulsout command on a PICAXE 08, this is my program:
search:
pulsout 4,750 'centre
pause 20
if pin1 = 1 then left
if pin2 = 1 then right
goto search
right:
for b0 = 1 to 10000
pulsout 4,1000
if pin1 = 1 then left
if pin2 = 0 then search
pause 20
next b0
left:
for b0 = 1 to 10000
pulsout 4, 500
if pin2 = 1 then right
if pin1 = 0 then search
pause 20
next b0
please if anyone can help i would be very thankful.
Â
i am currently making a remote control boat, and i am using a servo motor to control a rudder. obviously i want it to go left when i press left and right when i press right, and then return to the middle when i let go.
my problem though is that i can get the servo going one way but not the other.
im using the pulsout command on a PICAXE 08, this is my program:
search:
pulsout 4,750 'centre
pause 20
if pin1 = 1 then left
if pin2 = 1 then right
goto search
right:
for b0 = 1 to 10000
pulsout 4,1000
if pin1 = 1 then left
if pin2 = 0 then search
pause 20
next b0
left:
for b0 = 1 to 10000
pulsout 4, 500
if pin2 = 1 then right
if pin1 = 0 then search
pause 20
next b0
please if anyone can help i would be very thankful.
Â