From 8e5763d8f4fb151fcac93f377ad8d3d9dbf7c525 Mon Sep 17 00:00:00 2001 From: Evan Kuykendall Date: Wed, 1 Dec 2021 19:49:42 -0800 Subject: [PATCH 1/6] Set motor id --- .vscode/settings.json | 3 ++- src/main/java/com/spartronics4915/frc/Constants.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 1412128..e8b47fb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,6 +18,7 @@ "**/.gradle": true, "**/.project": true, "**/.factorypath": true, - "**/*~": true + "**/*~": true, + "**/.settings": true } } 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; } From b4486998e208dbf74298b1319e9e810c05fdcf8c Mon Sep 17 00:00:00 2001 From: Evan Kuykendall Date: Wed, 1 Dec 2021 20:06:38 -0800 Subject: [PATCH 2/6] Fixed Problems maybe --- src/main/java/com/spartronics4915/frc/RobotContainer.java | 2 +- .../com/spartronics4915/frc/subsystems/ExampleSubsystem.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/spartronics4915/frc/RobotContainer.java b/src/main/java/com/spartronics4915/frc/RobotContainer.java index edfe018..f1c6e76 100644 --- a/src/main/java/com/spartronics4915/frc/RobotContainer.java +++ b/src/main/java/com/spartronics4915/frc/RobotContainer.java @@ -26,7 +26,7 @@ public class RobotContainer public RobotContainer() { // ...and constructed here. - mExampleSubsystem = new ExampleSubsystem(); + mExampleSubsystem = ExampleSubsystem.getInstance(); mAutoCommand = new ExampleCommand(mExampleSubsystem); configureButtonBindings(); diff --git a/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java b/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java index ec97310..841a529 100644 --- a/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java +++ b/src/main/java/com/spartronics4915/frc/subsystems/ExampleSubsystem.java @@ -30,7 +30,7 @@ public ExampleSubsystem() logInitialized(success); } - public static ExampleSubsystem getsInstance() + public static ExampleSubsystem getInstance() { if (sInstance == null) { sInstance = new ExampleSubsystem(); From 8285699f8ce4b13e270f8b92ce85eb88a3c36692 Mon Sep 17 00:00:00 2001 From: Evan Kuykendall Date: Wed, 15 Dec 2021 19:14:22 -0800 Subject: [PATCH 3/6] awesome --- quotes.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 quotes.txt 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 From 9b43f0f58beaf910d33a2d68551c5a9828d1c8eb Mon Sep 17 00:00:00 2001 From: Noah <44441682+TheHarmonicRealm@users.noreply.github.com> Date: Wed, 15 Dec 2021 19:23:10 -0800 Subject: [PATCH 4/6] Undo evan's edit to settings.json --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e8b47fb..a31f6e5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,7 +18,7 @@ "**/.gradle": true, "**/.project": true, "**/.factorypath": true, - "**/*~": true, - "**/.settings": true + "**/*~": true + } } From 3a9c1aceac488ea7737c22ba433def3e0eec7ba4 Mon Sep 17 00:00:00 2001 From: Randy Groves Date: Thu, 23 Dec 2021 11:43:19 -0800 Subject: [PATCH 5/6] Changed the controller from Talon to SparkMAX Also added some debug messages to the SmartDashboard --- .../java/com/spartronics4915/frc/Robot.java | 3 +++ .../spartronics4915/frc/RobotContainer.java | 3 +++ .../frc/commands/ExampleCommand.java | 2 +- .../frc/subsystems/ExampleSubsystem.java | 23 +++++++++++++++---- 4 files changed, 26 insertions(+), 5 deletions(-) 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 f1c6e76..051e8e1 100644 --- a/src/main/java/com/spartronics4915/frc/RobotContainer.java +++ b/src/main/java/com/spartronics4915/frc/RobotContainer.java @@ -2,6 +2,8 @@ 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; @@ -30,6 +32,7 @@ public RobotContainer() 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 841a529..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) { @@ -41,16 +51,21 @@ public static ExampleSubsystem getInstance() // 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 From 1cced4a477aba0995c0942082e8a37f7b7447ab1 Mon Sep 17 00:00:00 2001 From: Noah <44441682+TheHarmonicRealm@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:35:58 -0800 Subject: [PATCH 6/6] pull from upstream --- src/main/java/com/spartronics4915/frc/RobotContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/spartronics4915/frc/RobotContainer.java b/src/main/java/com/spartronics4915/frc/RobotContainer.java index 051e8e1..5b344e4 100644 --- a/src/main/java/com/spartronics4915/frc/RobotContainer.java +++ b/src/main/java/com/spartronics4915/frc/RobotContainer.java @@ -9,7 +9,7 @@ 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.