 
 void calculateVelocities(){
 
+  acquireLock();
+
+  ch3 = floor(ch3/RC_ROUNDING_BASE)*RC_ROUNDING_BASE;
   velocity = map(ch3, RC_LOW_CH3, RC_HIGH_CH3, ESC_MIN, ESC_MAX);
   
+  releaseLock();
+
   if((velocity < ESC_MIN) || (velocity > ESC_MAX)) velocity = velocityLast;
   
   velocityLast = velocity;

void computePID(){

  acquireLock();
  roundInput();
  
  ch2 = map(ch2, RC_LOW_CH2, RC_HIGH_CH2, PITCH_MIN, PITCH_MAX);
  ch1 = map(ch1, RC_LOW_CH1, RC_HIGH_CH1, ROLL_MIN, ROLL_MAX);
  ch4 = map(ch4, RC_LOW_CH4, RC_HIGH_CH4, YAW_MIN, YAW_MAX);

    
    }

}

/*  calculateVelocities function
