   switch (digitalRead(pinH) ? HIGH : (digitalRead(pinL) ? LOW : NEUTRAL))
   {
     case HIGH:
-      if ((adj += RAMP_ADJUST) >= RAMP_MAX)
+      if ((adj += RAMP_ADJUST) > RAMP_MAX)
         adj = RAMP_MAX;
       break;
 
     case LOW:
-      if ((adj -= RAMP_ADJUST) <= RAMP_MIN)
+      if ((adj -= RAMP_ADJUST) < RAMP_MIN)
         adj = RAMP_MIN;
       break;
 

{
  // reset current if no stick flag or if adj and current are opposite signs
  if (!(adj || stick) || (current > 0 && adj < 0) || (current < 0 && adj > 0))
    current = 0;

  current += adj;
  

  if (current > DIR_MAX)
    current = DIR_MAX;

  if (current < DIR_MIN)
    current = DIR_MIN;

  return (current);
}

#define PIN_OP_ACG5 0

// delays
#define DELAY_LOOP 100
#define DELAY_START 30
#define DELAY_OP 100

