Skip to content

Instantly share code, notes, and snippets.

@airbornehurdle
Created January 6, 2019 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save airbornehurdle/365443fea3e9742a80f0ab14b182d8ea to your computer and use it in GitHub Desktop.
Save airbornehurdle/365443fea3e9742a80f0ab14b182d8ea to your computer and use it in GitHub Desktop.
/*----------------------------------------------------------------------------*/
/* 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