Skip to content

Instantly share code, notes, and snippets.

@ArchdukeTim
Created September 13, 2015 01:27
Show Gist options
  • Save ArchdukeTim/8eadfadeef17e1ea22a3 to your computer and use it in GitHub Desktop.
Save ArchdukeTim/8eadfadeef17e1ea22a3 to your computer and use it in GitHub Desktop.
package com.qualcomm.ftcrobotcontroller.opmodes;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
/**
* Created by winterst on 9/12/15.
*/
public class Arcade extends OpMode{
DcMotor motorRight;
DcMotor motorLeft;
Object [] components;
Drive drive;
public void init()
{
motorRight = hardwareMap.dcMotor.get("motor_2");
motorLeft = hardwareMap.dcMotor.get("motor_1");
motorLeft.setDirection(DcMotor.Direction.REVERSE);
drive = new Drive(motorRight, motorLeft);
Object [] components = {
drive
};
}
public void loop()
{
drive.move(gamepad1.left_stick_x, gamepad1.left_stick_y);
for(Object component: components)
{
component.doit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment