-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roller mech #2
base: main
Are you sure you want to change the base?
Roller mech #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package frc.robot.subsystems; | ||
|
||
import frc.robot.Constants.RollerConstants; | ||
import com.ctre.phoenix6.signals.MotorTypeValue; | ||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.CANSparkLowLevel.MotorType; | ||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
|
||
public class RollerSubsystem extends SubsystemBase { | ||
static double speed; | ||
private final CANSparkMax rollerMotor; | ||
/** Creates a new ExampleSubsystem. */ | ||
public RollerSubsystem() { | ||
speed = 0; | ||
rollerMotor = new CANSparkMax(RollerConstants.ROLLER_MOTOR_ID, MotorType.kBrushless); | ||
} | ||
|
||
/** | ||
* Example command factory method. | ||
* | ||
* @return a command | ||
*/ | ||
|
||
//sets the speed of the rollers | ||
public static void setSpeed(double newSpeed){ | ||
speed = newSpeed; | ||
} | ||
/** | ||
* An example method querying a boolean state of the subsystem (for example, a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update or delete the comments pls 😭 |
||
* digital sensor). | ||
* | ||
* @return value of some boolean subsystem state, such as a digital sensor. | ||
*/ | ||
|
||
//sets the actuall speed of the rollers | ||
@Override | ||
public void periodic() { | ||
// This method will be called once per scheduler run | ||
rollerMotor.set(speed); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend writing a method to set the speed instead of putting it in periodic and set speed every time even when there's no new updates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bump |
||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"fileName": "REVLib.json", | ||
"name": "REVLib", | ||
"version": "2024.2.4", | ||
"frcYear": "2024", | ||
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", | ||
"mavenUrls": [ | ||
"https://maven.revrobotics.com/" | ||
], | ||
"jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2024.json", | ||
"javaDependencies": [ | ||
{ | ||
"groupId": "com.revrobotics.frc", | ||
"artifactId": "REVLib-java", | ||
"version": "2024.2.4" | ||
} | ||
], | ||
"jniDependencies": [ | ||
{ | ||
"groupId": "com.revrobotics.frc", | ||
"artifactId": "REVLib-driver", | ||
"version": "2024.2.4", | ||
"skipInvalidPlatforms": true, | ||
"isJar": false, | ||
"validPlatforms": [ | ||
"windowsx86-64", | ||
"windowsx86", | ||
"linuxarm64", | ||
"linuxx86-64", | ||
"linuxathena", | ||
"linuxarm32", | ||
"osxuniversal" | ||
] | ||
} | ||
], | ||
"cppDependencies": [ | ||
{ | ||
"groupId": "com.revrobotics.frc", | ||
"artifactId": "REVLib-cpp", | ||
"version": "2024.2.4", | ||
"libName": "REVLib", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": false, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"windowsx86", | ||
"linuxarm64", | ||
"linuxx86-64", | ||
"linuxathena", | ||
"linuxarm32", | ||
"osxuniversal" | ||
] | ||
}, | ||
{ | ||
"groupId": "com.revrobotics.frc", | ||
"artifactId": "REVLib-driver", | ||
"version": "2024.2.4", | ||
"libName": "REVLibDriver", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": false, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"windowsx86", | ||
"linuxarm64", | ||
"linuxx86-64", | ||
"linuxathena", | ||
"linuxarm32", | ||
"osxuniversal" | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"fileName": "Phoenix5.json", | ||
"name": "CTRE-Phoenix (v5)", | ||
"version": "5.33.1", | ||
"frcYear": 2024, | ||
"uuid": "ab676553-b602-441f-a38d-f1296eff6537", | ||
"mavenUrls": [ | ||
"https://maven.ctr-electronics.com/release/" | ||
], | ||
"jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2024-latest.json", | ||
"requires": [ | ||
{ | ||
"uuid": "e995de00-2c64-4df5-8831-c1441420ff19", | ||
"errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", | ||
"offlineFileName": "Phoenix6.json", | ||
"onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2024-latest.json" | ||
} | ||
], | ||
"javaDependencies": [ | ||
{ | ||
"groupId": "com.ctre.phoenix", | ||
"artifactId": "api-java", | ||
"version": "5.33.1" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix", | ||
"artifactId": "wpiapi-java", | ||
"version": "5.33.1" | ||
} | ||
], | ||
"jniDependencies": [ | ||
{ | ||
"groupId": "com.ctre.phoenix", | ||
"artifactId": "cci", | ||
"version": "5.33.1", | ||
"isJar": false, | ||
"skipInvalidPlatforms": true, | ||
"validPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"linuxathena" | ||
], | ||
"simMode": "hwsim" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix.sim", | ||
"artifactId": "cci-sim", | ||
"version": "5.33.1", | ||
"isJar": false, | ||
"skipInvalidPlatforms": true, | ||
"validPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"osxuniversal" | ||
], | ||
"simMode": "swsim" | ||
} | ||
], | ||
"cppDependencies": [ | ||
{ | ||
"groupId": "com.ctre.phoenix", | ||
"artifactId": "wpiapi-cpp", | ||
"version": "5.33.1", | ||
"libName": "CTRE_Phoenix_WPI", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": true, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"linuxathena" | ||
], | ||
"simMode": "hwsim" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix", | ||
"artifactId": "api-cpp", | ||
"version": "5.33.1", | ||
"libName": "CTRE_Phoenix", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": true, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"linuxathena" | ||
], | ||
"simMode": "hwsim" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix", | ||
"artifactId": "cci", | ||
"version": "5.33.1", | ||
"libName": "CTRE_PhoenixCCI", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": true, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"linuxathena" | ||
], | ||
"simMode": "hwsim" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix.sim", | ||
"artifactId": "wpiapi-cpp-sim", | ||
"version": "5.33.1", | ||
"libName": "CTRE_Phoenix_WPISim", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": true, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"osxuniversal" | ||
], | ||
"simMode": "swsim" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix.sim", | ||
"artifactId": "api-cpp-sim", | ||
"version": "5.33.1", | ||
"libName": "CTRE_PhoenixSim", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": true, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"osxuniversal" | ||
], | ||
"simMode": "swsim" | ||
}, | ||
{ | ||
"groupId": "com.ctre.phoenix.sim", | ||
"artifactId": "cci-sim", | ||
"version": "5.33.1", | ||
"libName": "CTRE_PhoenixCCISim", | ||
"headerClassifier": "headers", | ||
"sharedLibrary": true, | ||
"skipInvalidPlatforms": true, | ||
"binaryPlatforms": [ | ||
"windowsx86-64", | ||
"linuxx86-64", | ||
"osxuniversal" | ||
], | ||
"simMode": "swsim" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove if not used