Programming Help, Please
jason_wu
Posts: 4
anyone can answer my question coz i need it very much....thanks you!!!!!!!!
Post Edited By Moderator (Jon Williams) : 9/16/2004 2:54:32 PM GMT
Post Edited By Moderator (Jon Williams) : 9/16/2004 2:54:32 PM GMT
Comments
Your code looks okay, except for one missing command.
You need to add a PAUSE 20 in the following places.
left_turn:
for pulse_count = 1 to 35
pulsout 12, 500
pulsout 13, 500
PAUSE 20 'add this line
next
goto main
right_turn:
for pulse_count = 1 to 35
pulsout 12, 1000
pulsout 13, 1000
PAUSE 20 'add this line
next
goto main
u_turn:
for pulse_count = 1 to 75
pulsout 12, 1000
pulsout 13, 1000
PAUSE 20 'add this line
next
goto main
The servos used in your robot need to have their commands sent at certain rate, 50 Hz.
The PAUSE 20 command inserts a delay of 20ms between each set of pulsout commands, which
essentially slows down the turning loops(left_turn, right_turn, etc) to a 50Hz rate.
I would also suggest that you test each little group of code, before you try to get the whole
robot to work.
Dave G.
and nice to meet you too....