SHARE
TWEET
Untitled
a guest
Nov 22nd, 2016
11
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- package org.firstinspires.ftc.teamcode;
- import com.qualcomm.robotcore.hardware.ColorSensor;
- import com.qualcomm.robotcore.hardware.DcMotor;
- import com.qualcomm.robotcore.hardware.HardwareMap;
- import com.qualcomm.robotcore.hardware.Servo;
- /**
- * Created by User on 10/24/2016.
- */
- public class RobotHardware {
- /* Declare OpMode members. */
- DcMotor driveLeft = null;
- DcMotor driveRight = null;
- DcMotor linearSlide = null;
- DcMotor shooterLaunch = null;
- DcMotor shooterIntake = null;
- Servo buttonPush = null;
- ColorSensor colorSensor = null;
- //public static final double buttonPush_MIN_RANGE = 0;
- //public static final double buttonPush_MAX_RANGE = 1;
- public double buttonPushPosition;
- public double buttonPushDelta;
- HardwareMap hwMap = null;
- public RobotHardware() {
- }
- public void init(HardwareMap ahwMap) {
- hwMap = ahwMap;
- driveRight = hwMap.dcMotor.get("motor_1");
- driveLeft = hwMap.dcMotor.get("motor_0");
- driveRight.setDirection(DcMotor.Direction.FORWARD);
- driveLeft.setDirection(DcMotor.Direction.REVERSE);
- linearSlide = hwMap.dcMotor.get("motor_2");
- shooterLaunch = hwMap.dcMotor.get("motor_4");
- shooterIntake = hwMap.dcMotor.get("motor_5");
- colorSensor = hwMap.colorSensor.get("color_0");
- driveRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
- driveLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
- linearSlide.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
- shooterLaunch.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
- shooterIntake.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
- driveRight.setPower(0);
- driveLeft.setPower(0);
- linearSlide.setPower(0);
- shooterLaunch.setPower(0);
- shooterIntake.setPower(0);
- buttonPush = hwMap.servo.get("servo_0");
- buttonPush.setPosition(0);
- }
- }
RAW Paste Data
