Robot controller (version 1)
Step # | Tag | Condition | Action | Next | Notes |
1 | Start | Always |
LED Off PWM: 200 freq=32766 | Start IR and reset LED (for when we finish turning) | |
2 | MainLoop | Input: XXXXXXX0 |
LED On | object | Check IR sensor |
3 | Always |
Pulse: pin 7 2000 | Drive forward | ||
4 | Always |
Pulse: pin 6 1000 | Drive forward | ||
5 | After 20 ms | MainLoop | Servo delay (20ms) | ||
6 | object | Always | back (set bookmark) | We detected something, so back up a little. | |
7 | turn | Always |
Set Loop A to 20 | Start turning (just under 1/2 second) | |
8 | turn0 | 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 | Start | If sensor shows clear (high) then go back to forward motion | ||
12 | Always | turn | Sensor wasn't clear so do some more turns | ||
13 | back | Always |
Set Loop A to 100 | Back up for about 2 seconds | |
14 | back0 | 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 |