servo program

husslemk4

New Member
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.

 
 

BeanieBots

Moderator
I don't think the 08 supports servo, the 08M does.
Your pulsout values do not look correct.
pulsout 4,150 is what I would expect for centre.
Left & right should be around 75 & 225 respectively.
 
Top