diff --git a/AutonomeTest.java b/AutonomeTest.java index 5f0db9b..581cd96 100644 --- a/AutonomeTest.java +++ b/AutonomeTest.java @@ -34,13 +34,14 @@ public class AutonomeTest extends LinearOpMode { droit.setDirection(DcMotorSimple.Direction.REVERSE); droit.setMode(DcMotorEx.RunMode.STOP_AND_RESET_ENCODER); droit.setZeroPowerBehavior(DcMotorEx.ZeroPowerBehavior.FLOAT); + moissonneuse = hardwareMap.get(DcMotor.class,"msn"); waitForStart(); boiteG.setTargetPosition(90); boiteD.setTargetPosition(90); - while (boiteG.getCurrentPosition()gauche.getTargetPosition()){ + while (opModeIsActive() && gauche.getCurrentPosition()>gauche.getTargetPosition()){ gauche.setVelocity(250); gauche.setMode(DcMotor.RunMode.RUN_TO_POSITION); droit.setVelocity(250); droit.setMode(DcMotor.RunMode.RUN_TO_POSITION); } + gauche.setTargetPosition(700*3); + droit.setTargetPosition(700*3); + + while (opModeIsActive() && gauche.getCurrentPosition()