Guide

ROBOTICS ADVENTURE BOOK  SCOUTER MANUAL  STEM 16
Putting Together the Drive Subroutines
Rather than putting all the commands to make up driving, turning, and keeping track of distance into your main loop,
you have created a block of subroutines to do those things that you can use over and over. In fact, you have even gone
further and made them so that the robot will continue to drive while the program does other things like read a distance
sensor or the sensors for moisture and hydrocarbons.
• The new operations (in subroutines) you have are:
• Drive (direction, distance)
• Turn (direction, angle)
• Rotate (direction, angle)
• Stop
• How Far? – Returns the distance since the start of the last “Drive” call
• Done? – Returns true if the last Drive, Turn or Rotate has completed