Robot keeps going in circle
robotlover4ever
Posts: 2
I created a code for a robot to go through this maze thing that I had built for it. The problem? It keeps going in circles. It can't be a problem with the code because the code has worked on my friends robot, but it won't work on mine. At first, I thought it was a battery problem.. but new batteries hasnt solved anything.
Whats the problem?
Here is the code for my robot.
Whats the problem?
Here is the code for my robot.
[FONT=arial]' {$STAMP BS2}[/FONT] [FONT=arial]DEBUG "Program Running!"[/FONT] [FONT=arial] [/FONT] [FONT=arial]counter VAR Word[/FONT] [FONT=arial] [/FONT] [FONT=arial]FREQOUT 4, 2000, 3000 ' Signal program start/reset.[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 220 ' Number of pulses - run time.[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650 ' Left servo full speed ccw.[/FONT] [FONT=arial] PULSOUT 12, 825 ' Right servo full speed cw.[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 40 ' Number of pulses - run time.[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650 ' Left servo full speed ccw.[/FONT] [FONT=arial] PULSOUT 12, 750 ' Right servo full speed cw.[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 45[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 845[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 40[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 750[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 120 ' Number of pulses - run time.[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650 ' Left servo full speed ccw.[/FONT] [FONT=arial] PULSOUT 12, 825 ' Right servo full speed cw.[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 40[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 750[/FONT] [FONT=arial] PULSOUT 12, 850[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 95[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 825[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 40[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 750[/FONT] [FONT=arial] PULSOUT 12, 850[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 67[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 825[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 37[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 750[/FONT] [FONT=arial] PULSOUT 12, 850[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 25[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 825[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 40[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 750[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 35[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 825[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 40[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 750[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]FOR counter = 1 TO 210[/FONT] [FONT=arial] [/FONT] [FONT=arial] PULSOUT 13, 650[/FONT] [FONT=arial] PULSOUT 12, 825[/FONT] [FONT=arial] PAUSE 20[/FONT] [FONT=arial] [/FONT] [FONT=arial]NEXT[/FONT] [FONT=arial] [/FONT] [FONT=arial]END[/FONT]