     // If not in Serial control overwrite the value 
   if (false == isSerialControl)
   {
-    // Compute the value corresponding to the deadband
-    double sensorDeadBandMax = sensorValueMin + (deadBand/2.0+0.5)*(sensorValueMax - sensorValueMin);
-    double sensorDeadBandMin = sensorValueMin + (-deadBand/2.0+0.5)*(sensorValueMax - sensorValueMin);
-    if (sensorValue < sensorDeadBandMin) //strictly to avoid alphaSigned equals zero
-    {
-      alphaSigned = (sensorValue-sensorValueMin)/(sensorDeadBandMax - sensorValueMin)-1;
-    } 
-    else
-    {
-      if (sensorValue > sensorDeadBandMax)
-      {
-        alphaSigned = (sensorValue-sensorDeadBandMax)/(sensorValueMax - sensorDeadBandMax);
-      }
-      else
-      {
-        alphaSigned = 0;
-      }
-    }
+  alphaSigned = (sensorValue-sensorValueMin)/(sensorValueMax - sensorValueMin);
   }
   alphaSigned = min(1, max(-1, alphaSigned));
 }

{
  if (serialFrequency != 0)
  { // Fallbacks to zero as we received no message in the expected time (twice the time)
    if ((millis()-lastSerialInputTime) > 2*1/serialFrequency*1000)
    {
      alphaSigned = 0;
    }

   }
  }
  Serial.println(inputString);
  inputString="";*/
}

void loop()
{
  sensorValue = analogRead(analogInPin);
  //Serial.println(sensorValue); 
  setMode();
  computeAlphaSigned();
  computeEnableState();
  computeLogicState();
  
  delayMicroseconds(minTime_us*random(100,300));


//  // print the results to the serial monitor:
//  Serial.print("alphaManual = " );                       
//  Serial.print(alphaSigned);      
//  Serial.print("\t alphaUsed = ");      
//  Serial.println(alphaSigned);   
}
void setMode()
{  
