\sourcecomment{Main Loop}
\begin{verbatim}
while (alive)
{
  get_sensor_data();  // read one or more sensors
  compute_control();  // calculate control parameters based on 
		             // incoming data 
  control_device();   // initiate control activity 
		             // read next group of
		             // sensors...calculate...control
}
\end{verbatim}
