     digitalWrite(HbridgeEnablePin, LOW);
     delay(minTime_ms);
     sensorValue = analogRead(analogInPin);
+    if (sensorValue < 10)
+    { 
+    // Motor is free to move to enable manual control
+      digitalWrite(HbridgeEnablePin, LOW);
+    }
+    else
+    { 
+      digitalWrite(HbridgeEnablePin, HIGH);
+    }
 //    Serial.print("sensorValue = " );                       
 //    Serial.println(sensorValue);   
-//    //alphaSigned = 2*((sensorValue-sensorValueMin)/(sensorValueMax - sensorValueMin)-0.5);  
-//    Serial.print("alphaSigned = " );                       
+  if (false==isSerialControl)
+  {
+    alphaSigned = 2*((sensorValue-sensorValueMin)/(sensorValueMax - sensorValueMin)-0.5);  
+  }
+  //    Serial.print("alphaSigned = " );                       
 //    Serial.println(alphaSigned);   
     alpha = max(fabs(alphaSigned), deadBand);
     alpha = min(alpha, 1);

  double sensorValueMax = 767;//1023
  double deadBand = 0.05; // Use to ensure zero speed. Should not be zero
  sensorValue = analogRead(analogInPin);
  // \todo: add a selection of voltage or serial input
  // alphaSigned = 2*((sensorValue-sensorValueMin)/(sensorValueMax - sensorValueMin)-0.5);  
  double alpha = max(fabs(alphaSigned), deadBand);
  alpha = min(alpha, 1);
  if (alphaSigned>fabs(deadBand))
  {
    // Forward rotation

      stringComplete = true;
    }
  }
  if (inputString == "i")
  {
    isSerialControl = true;
  }
  else
  {
   if (inputString == "o")
   {
     isSerialControl = false;
   }
   else
   {
     alphaSigned = StrToFloat(inputString);
   }
  }
  Serial.println(inputString);
  Serial.println(alphaSigned);
  inputString="";
