package org.ftcTeam.utils;

import com.qualcomm.robotcore.hardware.DcMotor;

import org.ftcbootstrap.components.operations.motors.MotorToEncoder;
import org.ftcbootstrap.components.utils.MotorDirection;

/**
 * Created by dkim on 1/11/17.
 */

public class EncoderBasedAutonomousUtil {



    public static void pauseMotorEncoder(MotorToEncoder motorR, MotorToEncoder motorL, MotorToEncoder motorBR, MotorToEncoder motorBL) {
            motorR.stop();
            motorL.stop();
            motorBR.stop();
            motorBL.stop();
    }

    public static void rotateMotor180(MotorToEncoder motorR, MotorToEncoder motorL, MotorToEncoder motorBR, MotorToEncoder motorBL) throws InterruptedException{
        //values
        int rotateMotor = 1140;

        motorR.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_FORWARD, DcMotor.RunMode.RUN_USING_ENCODER);
        motorL.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_FORWARD, DcMotor.RunMode.RUN_USING_ENCODER);
        motorBR.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_FORWARD, DcMotor.RunMode.RUN_USING_ENCODER);
        motorBL.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_FORWARD, DcMotor.RunMode.RUN_USING_ENCODER);
    }


}

@@ -1196,11 +1196,892 @@
 %0A    %7D%0A%0A
+    public static boolean strafLeft(MotorToEncoder motorR, MotorToEncoder motorL, MotorToEncoder motorBR, MotorToEncoder motorBL) throws InterruptedException%7B%0A        //values%0A        int rotateMotor = 1140;%0A%0A        boolean isFRDone = motorR.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_FORWARD, DcMotor.RunMode.RUN_USING_ENCODER);%0A        boolean isFLDone = motorL.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_FORWARD, DcMotor.RunMode.RUN_USING_ENCODER);%0A        boolean isBRDone = motorBR.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_BACKWARD, DcMotor.RunMode.RUN_USING_ENCODER);%0A        boolean isBLDone = motorBL.runToTarget(.5, rotateMotor, MotorDirection.MOTOR_BACKWARD, DcMotor.RunMode.RUN_USING_ENCODER);%0A%0A        if (isFRDone && isFLDone && isBRDone && isBLDone) %7B%0A            return true;%0A        %7D%0A        else %7B%0A            return false;%0A        %7D%0A    %7D
 %0A%7D%0A

Add stafleft