Specifications
87
Software Specification
Execution structures, Pseudocode
MAIN set the stack pointer in a clear area
Clear computer watchdog
Initialise serial port
Initialise Kew Wake up on port G
Initialise IRQ Interrupt
Initialise port A
Start loop check sensor for objects
Branch to turn if necessary
Check odometer counters and branch to compare if necessary
Repeat loop.
DRFWD start both wheels driving forwards
Return to main
TURNL ensure signal not just noise
if left blocked, jump to turn right
transmit an L through the serial port
Stop the motors
Turn motor B backwards until robot turned 90 degrees
Stop turning
Continue in straight path (jump to DRFWD)
Return to main
TURNR ensure signal not just noise
if right blocked, jump to backup
transmit an R through the serial port
Stop the motors
Turn motor A backwards until robot turned 90 degrees
Stop turning
Continue in straight path (jump to DRFWD)
Return to main










