Centering Ping Servo
Hatem
Posts: 20
Hello everyone, I have the compass module mounted on the Ping Servo mounting bracket. Every time I turn on the Bot, the Ping servo moves a little to the right and I have to add a long pause time at the beginning of the program to manually center the ping. Is there a way to overcome this glitch???
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Correct_Heading:
IF (Angle2 - Angle1) < (Angle1/20) THEN
InitialValue = InitialValue + 140
ELSEIF (Angle2 - Angle1) > (Angle1/20) THEN
GOSUB Turn_to_Heading
ENDIF
RETURN
Turn_to_Heading: '*** I am not sure if this is correct, the Boe-Bot
'*** will turn untill it becomes within 5 % error of
relBearing = 360 - (Angle2 - Angle1) '*** Angle1 beofre an object is detected
counter = relBearing - Angle1
DO
PULSOUT LeftServo, 850 ' Left Servo Pulse Value
PULSOUT RightServo, 850 ' Right Servo Pulse Value
PAUSE 20
LOOP UNTIL counter = 0
InitialValue = InitialValue + 140
RETURN
My bot just keeps on turning nonstop. I am not sure how to perform this task.
Put a "Counter = Counter - 1" inside the do loop to fix this.