Shop OBEX P1 Docs P2 Docs Learn Events
programming — Parallax Forums

programming

nerdnerd Posts: 2
edited 2008-11-11 22:30 in Robotics
does anyone know how (if possible) to move the boebot around a room sensing objects while in movement using the ping distance sensor and·without using the ir sensor? when i get both the boebot moving forward and the ping distance sensor displaying·measurements on the debug terminal, the boe bot drives forward in pulses instead of in a smooth drive·....how can i fix this problem??·heres the basic code i got for movements and distance detection:·· ...try it out and you will see what i mean..

' {$STAMP BS2}
'{$PBASIC 2.5}

time VAR Word

DO
· PULSOUT 13,850
· PULSOUT 12, 650
· PULSOUT 15, 5
· PULSIN 15, 1, time
· DEBUG HOME, "time = ", DEC5 time
· PAUSE 100
· time = time ** 2251
· DEBUG CR, "Distance = ", DEC4 time, " cm"
LOOP

Comments

Sign In or Register to comment.