   // Initialize debugging serial console.
   Serial.begin(115200);
   
+  // Start the system in the disconnected state
+  system_state = DISCONNECTED;
+  
   // Make the ADK buffers into null terminated string.
   debug_buffer[INPUT_BUFFER_SIZE] = '\0';
   input_buffer[INPUT_BUFFER_SIZE] = '\0';

 */
void motorUpdateLoop()
{
  // Only run while connected via USB.
  if (!adk.isReady()) {
    yield();
    return;
  }
  
  // Wait for a fixed time period.
  delay(100);
  
  // Decay all motors exponentially towards zero speed.
  //for (size_t motor_idx = 0; motor_idx < NUM_MOTORS; ++motor_idx) {
  //  motor[motor_idx]->velocity(motor[motor_idx]->velocity() * 0.8);
  //}
  
  // TODO: move this to another location (e.g. Motor)
  // Send motor status update over USB
  snprintf(output_buffer, OUTPUT_BUFFER_SIZE,
    "{"
      "\"m0\":{"
        "\"v\":%f,"
        "\"c\":%f"
      "},"
      "\"m1\":{"
        "\"v\":%f,"
        "\"c\":%f"
      "}"
    "}",
    motor[0]->velocity(), motor[0]->current(),
    motor[1]->velocity(), motor[1]->current()
  );
  send(output_buffer);
  
  // TODO: Remove this hack
  // Send encoder status update over USB
  long pos = ((platypus::Winch*)sensor[2])->position();
  snprintf(output_buffer, OUTPUT_BUFFER_SIZE,
    "{"
      "\"s2\":{"
        "\"type\":\"winch\","
        "\"depth\":%ld"
      "}"
    "}",
    pos
  );
  send(output_buffer);
}

/**


const size_t OUTPUT_BUFFER_SIZE = 576;
char output_buffer[OUTPUT_BUFFER_SIZE+3];

// System state enumeration
enum SystemState
{
  /** There is no ADK USB device currently plugged in. */
  DISCONNECTED,
  /** There is an ADK USB device detected, but it is unresponsive. */
  CONNECTED,
  /** There is a Platypus Server currently communicating. */
  RUNNING  
};
SystemState system_state = DISCONNECTED;

// Number of empty reads before we consider the Android
// server to be unresponsive.
const size_t RESPONSE_TIMEOUT = 255;

// Define the systems on this board
// TODO: move this board.h?
