I:\Documents\Visual Studio 2008\Projects\gpseq\Examples\robot1.gp3

Robot controller (version 1)

Step #TagConditionActionNextNotes
1Start Always LED Off
PWM: 200 freq=32766
 Start IR and reset LED (for when we finish turning)
2MainLoop Input: XXXXXXX0 LED On
objectCheck IR sensor
3  Always Pulse: pin 7 2000
 Drive forward
4  Always Pulse: pin 6 1000
 Drive forward
5  After 20 ms   MainLoopServo delay (20ms)
6object Always   back (set bookmark)We detected something, so back up a little.
7turn Always Set Loop A to 20
 Start turning (just under 1/2 second)
8turn0 Always Pulse: pin 7 2000
 pulse motors the same way
9  Always Pulse: pin 6 2000
 Inserted step
10  After 20 ms   turn0 (Loop A)Pause and loop for 2 seconds
11  Input: XXXXXXX1   StartIf sensor shows clear (high) then go back to forward motion
12  Always   turnSensor wasn't clear so do some more turns
13back Always Set Loop A to 100
 Back up for about 2 seconds
14back0 Always Pulse: pin 7 1000
 Turn motors in reverse
15  Always Pulse: pin 6 2000
16  After 20 ms   back0 (Loop A)Delay and loop
17  Always   {last bookmark}Go back to caller