-
-
Save airbornehurdle/365443fea3e9742a80f0ab14b182d8ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------------------------------*/ | |
/* Copyright (c) 2018 FIRST. All Rights Reserved. */ | |
/* Open Source Software - may be modified and shared by FRC teams. The code */ | |
/* must be accompanied by the FIRST BSD license file in the root directory of */ | |
/* the project. */ | |
/*----------------------------------------------------------------------------*/ | |
package frc.robot.subsystems; | |
import edu.wpi.first.wpilibj.Spark; | |
import edu.wpi.first.wpilibj.SpeedControllerGroup; | |
import edu.wpi.first.wpilibj.command.Subsystem; | |
import edu.wpi.first.wpilibj.drive.DifferentialDrive; | |
import frc.robot.RobotMap; | |
/** | |
* Add your docs here. | |
*/ | |
public class DriveSubsystem extends Subsystem { | |
// Instantiate new motor controller objects with SpeedController | |
public Spark leftFrontMotor = new Spark(RobotMap.leftFrontMotor); | |
public Spark leftRearMotor = new Spark(RobotMap.leftRearMotor); | |
public SpeedControllerGroup leftMotorGroup = new SpeedControllerGroup(leftFrontMotor, leftRearMotor); | |
public Spark rightFrontMotor = new Spark(RobotMap.rightFrontMotor); | |
public Spark rightRearMotor = new Spark(RobotMap.rightRearMotor); | |
public SpeedControllerGroup rightMotorGroup = new SpeedControllerGroup(rightFrontMotor, rightRearMotor); | |
// Instantiate a new DifferentialDrive object and assign the SpeedControllerGroups | |
public DifferentialDrive drive = new DifferentialDrive(leftMotorGroup, rightMotorGroup); | |
// Manual Tank Drive | |
@Override | |
public void initDefaultCommand() { | |
// Set the default command for a subsystem here. | |
// setDefaultCommand(new MySpecialCommand()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment