   if (action) roboclaw.begin(38400);
   else roboclaw.end();
   driveEnabled = action;
+}
+
+void CheckDriveCommandTimeout()
+{
+  if (driveCommandTimeout == 0) return;
+  unsigned long driveCommandTime = millis();
+  if (driveCommandTime >= lastDriveCommandTime) driveCommandTime -= lastDriveCommandTime; else lastDriveCommandTime = 0;
+  if (driveCommandTime > driveCommandTimeout) driveEnable(false);
 }
 
 //=======================================


// common vars //
unsigned long lastCommandTime;
unsigned long commandTime;
unsigned long cmdTimeout = 2500;
boolean IsConnected = false;

// RoboClaw //


void CheckCommandTimeout()
{
  if (commandTimeout == 0) return;
  unsigned long commandTime = millis();
  if (commandTime >= lastCommandTime) commandTime -= lastCommandTime; else lastCommandTime = 0;
  if (commandTime > commandTimeout) OnDisconnected();
}

void OnDisconnected()
