Skip to content
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

one motor indexer #14

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import edu.wpi.first.gradlerio.deploy.roborio.RoboRIO

plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2022.1.1"
id "edu.wpi.first.GradleRIO" version "2022.2.1"
}

sourceCompatibility = JavaVersion.VERSION_11
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/usfirst/frc4904/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import edu.wpi.first.wpilibj2.command.Subsystem;
import org.usfirst.frc4904.standard.custom.controllers.CustomJoystick;
import org.usfirst.frc4904.standard.custom.controllers.CustomXbox;
import org.usfirst.frc4904.standard.custom.motioncontrollers.CANTalonFX;
import org.usfirst.frc4904.standard.subsystems.motor.Motor;

public class RobotMap {
public static class Port {
Expand All @@ -12,6 +14,7 @@ public static class HumanInput {
}

public static class CANMotor {
public static final int indexerMotor = -1; // TODO: set port
}

public static class PWM {
Expand Down Expand Up @@ -51,6 +54,8 @@ public static class Turn {
}

public static class Component {
public static Motor indexerMotor;
public static Motor motor;
}

public static class Input {
Expand All @@ -70,5 +75,6 @@ public RobotMap() {
HumanInput.Driver.xbox = new CustomXbox(Port.HumanInput.xboxController);
HumanInput.Operator.joystick = new CustomJoystick(Port.HumanInput.joystick);

Component.indexerMotor = new Motor("indexerMotor", false, new CANTalonFX(Port.CANMotor.indexerMotor)); // TODO: Need to check motor inversion
}
}
}
15 changes: 15 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/commands/IndexerOff.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.usfirst.frc4904.robot.commands;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.motor.MotorIdle;


public class IndexerOff extends MotorIdle {

/**
* Set indexer motor speed to zero
*/
public IndexerOff() {
super(RobotMap.Component.indexerMotor);
}
}
11 changes: 11 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/commands/IndexerOn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.usfirst.frc4904.robot.commands;

import org.usfirst.frc4904.robot.RobotMap;
import org.usfirst.frc4904.standard.commands.motor.MotorConstant;

public class IndexerOn extends MotorConstant {
public final static double DEFAULT_INTAKE_MOTOR_SPEED = 0.5; //TODO: needs value
public IndexerOn() {
super("IndexerOn", RobotMap.Component.motor, DEFAULT_INTAKE_MOTOR_SPEED);
}
}