File tree Expand file tree Collapse file tree
TeamCode/src/main/java/org/firstinspires/ftc/teamcode Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ public class mecanumFieldOriented extends LinearOpMode {
5353 public static Orientation angles ;
5454 public static Acceleration gravity ;
5555 int ticks = 0 ;
56+ int grabberPos = 0 ;
5657
5758 BNO055IMU imu ;
5859
@@ -84,7 +85,7 @@ public void runOpMode() {
8485 BNO055IMU imu = hardwareMap .get (BNO055IMU .class , "imu" );
8586
8687
87-
88+ grabber . setPosition ( 180 );
8889 initIMU (hardwareMap );
8990 telemetry .addData ("Status" , "Initialized" );
9091 telemetry .update ();
@@ -156,7 +157,22 @@ public void runOpMode() {
156157
157158 }
158159
160+ if (gamepad1 .dpad_left ){
161+ grabberPos ++;
162+ }else if (gamepad1 .dpad_right ){
163+ grabberPos --;
164+ }
165+
166+ if (grabberPos >= 180 ){
167+ grabberPos = 180 ;
168+ } else if (grabberPos <= 90 ){
169+ grabberPos = 90 ;
170+ }
171+
159172
173+ if (gamepad1 .right_trigger && gamepad1 .left_trigger ){
174+ initIMU (hardwareMap );
175+ }
160176
161177 if (gamepad1 .dpad_up ){
162178 ticks ++;
@@ -171,7 +187,7 @@ public void runOpMode() {
171187
172188
173189 //control carousel wheel
174- if (gamepad1 .x || gamepad2 . x ) {
190+ if (gamepad1 .x ) {
175191 duckies .setPower (-0.8 );
176192 } else {
177193 duckies .setPower (0 );
You can’t perform that action at this time.
0 commit comments