MotorRotationCount function