Advertisement
roll11226

Auto

Jan 24th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package org.firstinspires.ftc.teamcode;
  2.  
  3. import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
  4. import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
  5. import com.qualcomm.robotcore.hardware.Servo;
  6. import com.qualcomm.robotcore.util.ElapsedTime;
  7.  
  8.  
  9.  
  10.  
  11. /**
  12.  * Created by FTC-computer on 12/22/10.
  13.  */
  14.  
  15. @Autonomous(name="Autonomous", group="tests")
  16.  
  17. public class Autonomus extends LinearOpMode {
  18.  
  19.     private KEY keyDetcter = new KEY();
  20.     private COLOR color = new COLOR();
  21.     private DRIVE drive = new DRIVE();
  22.  
  23.  
  24.     private ElapsedTime time = new ElapsedTime();
  25.  
  26.     private int work = 0;
  27.  
  28.     private Servo rightServo = null;
  29.     private Servo leftServo = null;
  30.  
  31.  
  32.     @Override
  33.     public void runOpMode() {
  34.         telemetry.addData("Status", "Initialized");
  35.         telemetry.update();
  36.         rightServo = hardwareMap.get(Servo.class, "right_servo");
  37.         leftServo = hardwareMap.get(Servo.class, "left_servo");
  38.         leftServo.setPosition(0.6);
  39.         rightServo.setPosition(0.4);
  40.         waitForStart();
  41.         time.reset();
  42.  
  43.  
  44.         while (opModeIsActive() && work == 0) {
  45.  
  46.             drive.driveForward(10, 1);
  47.             work++;
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement