diff --git a/.vscode/settings.json b/.vscode/settings.json index 1412128..a31f6e5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,6 @@ "**/.project": true, "**/.factorypath": true, "**/*~": true + } } diff --git a/quotes.txt b/quotes.txt new file mode 100644 index 0000000..d2de4c2 --- /dev/null +++ b/quotes.txt @@ -0,0 +1,2 @@ +"beep bop boop I make lines" +-Evan Kuykendall, 2021 \ No newline at end of file diff --git a/src/main/java/com/spartronics4915/frc/Constants.java b/src/main/java/com/spartronics4915/frc/Constants.java index df97d6f..9e22c12 100644 --- a/src/main/java/com/spartronics4915/frc/Constants.java +++ b/src/main/java/com/spartronics4915/frc/Constants.java @@ -11,5 +11,5 @@ */ public final class Constants { - public static final int kTestMotorId = 0; + public static final int kTestMotorId = 1; } diff --git a/src/main/java/com/spartronics4915/frc/Robot.java b/src/main/java/com/spartronics4915/frc/Robot.java index dfdaeaf..6498321 100644 --- a/src/main/java/com/spartronics4915/frc/Robot.java +++ b/src/main/java/com/spartronics4915/frc/Robot.java @@ -3,6 +3,8 @@ import edu.wpi.first.wpilibj.TimedRobot; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.CommandScheduler; +import com.spartronics4915.lib.subsystems.SpartronicsSubsystem; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; public class Robot extends TimedRobot { @@ -38,6 +40,7 @@ public void robotPeriodic() // periodic() methods. // This must be called from the robot's periodic block in order for // anything in the command-based framework to work. + SmartDashboard.putString("robotPeriodic","Entered"); CommandScheduler.getInstance().run(); } diff --git a/src/main/java/com/spartronics4915/frc/RobotContainer.java b/src/main/java/com/spartronics4915/frc/RobotContainer.java index edfe018..5b344e4 100644 --- a/src/main/java/com/spartronics4915/frc/RobotContainer.java +++ b/src/main/java/com/spartronics4915/frc/RobotContainer.java @@ -2,12 +2,14 @@ import com.spartronics4915.frc.commands.ExampleCommand; import com.spartronics4915.frc.subsystems.ExampleSubsystem; +import com.spartronics4915.lib.subsystems.SpartronicsSubsystem; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; -// Troy Edwards was here +// /** * This class is where the bulk of the robot should be declared. @@ -26,10 +28,11 @@ public class RobotContainer public RobotContainer() { // ...and constructed here. - mExampleSubsystem = new ExampleSubsystem(); + mExampleSubsystem = ExampleSubsystem.getInstance(); mAutoCommand = new ExampleCommand(mExampleSubsystem); configureButtonBindings(); + SmartDashboard.putString("Container","Completed"); } /** Use this method to define your button ==> command mappings. */ diff --git a/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java b/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java index f7168df..6643627 100644 --- a/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java +++ b/src/main/java/com/spartronics4915/frc/commands/ExampleCommand.java @@ -25,7 +25,7 @@ public ExampleCommand(ExampleSubsystem subsystem) // Called when the command is initially scheduled. @Override public void initialize() { - mExampleSubsystem.startTestMotor(1.0); + mExampleSubsystem.startTestMotor(0.3); } // Called every time the scheduler runs while the command is scheduled. diff --git a/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java b/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java index ec97310..58f55c9 100644 --- a/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java +++ b/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java @@ -3,7 +3,17 @@ import com.spartronics4915.frc.Constants; import com.spartronics4915.lib.subsystems.SpartronicsSubsystem; -import edu.wpi.first.wpilibj.Talon; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; + +import com.revrobotics.CANError; +import com.revrobotics.CANSparkMax; +import com.revrobotics.CANSparkMax.IdleMode; +import com.revrobotics.CANSparkMaxLowLevel.MotorType; + +/** + * We're not using Talon any more + * import edu.wpi.first.wpilibj.Talon; + * / /** * Detailed description of ExampleSubsystem. @@ -12,7 +22,7 @@ public class ExampleSubsystem extends SpartronicsSubsystem { private static ExampleSubsystem sInstance = null; // The subsystem's hardware is defined here... - private static Talon mTestMotor; + private static CANSparkMax mTestMotor; /** Creates a new ExampleSubsystem. */ public ExampleSubsystem() @@ -20,7 +30,7 @@ public ExampleSubsystem() boolean success = true; try { - mTestMotor = new Talon(Constants.kTestMotorId); + mTestMotor = new CANSparkMax(Constants.kTestMotorId,MotorType.kBrushless); } catch (Exception exception) { @@ -30,7 +40,7 @@ public ExampleSubsystem() logInitialized(success); } - public static ExampleSubsystem getsInstance() + public static ExampleSubsystem getInstance() { if (sInstance == null) { sInstance = new ExampleSubsystem(); @@ -41,16 +51,21 @@ public static ExampleSubsystem getsInstance() // Subsystem methods - actions the robot can take - should be placed here. public void startTestMotor(double speed) { + SmartDashboard.putString("Motor","Starting motor"); mTestMotor.set(speed); + SmartDashboard.putNumber("Speed",mTestMotor.get()); } public void stopTestMotor() { + SmartDashboard.putString("Motor","Stopping motor"); mTestMotor.set(0.0); } /** This method will be called once per scheduler run. */ @Override - public void periodic() {} + public void periodic() { + SmartDashboard.putString("Periodic","Starting"); + } /** This method will be called once per scheduler run during simulation. */ @Override