From eed163266ba98242448ddd85a4e59f5a85e80734 Mon Sep 17 00:00:00 2001 From: GZod01 Date: Sun, 12 May 2024 15:54:51 +0200 Subject: [PATCH] autonometest --- AutonomeTest.java | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) 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()