-
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
Arms_Deployable #3
base: main
Are you sure you want to change the base?
Changes from 2 commits
73827e4
15729f4
3de70b4
2d15e2e
19ab892
80c070e
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,83 @@ | ||
package org.wildstang.year2023.subsystems.Intake; | ||
|
||
import org.wildstang.framework.io.inputs.Input; | ||
import org.wildstang.framework.subsystems.Subsystem; | ||
import org.wildstang.hardware.roborio.inputs.WsJoystickButton; | ||
import org.wildstang.hardware.roborio.outputs.WsSolenoid; | ||
import org.wildstang.hardware.roborio.outputs.WsSparkMax; | ||
import org.wildstang.year2023.robot.WSInputs; | ||
import org.wildstang.year2023.robot.WSOutputs; | ||
|
||
public class Deployable implements Subsystem { | ||
|
||
private WsSparkMax intake1; | ||
private WsJoystickButton deployRevIntake; | ||
private WsSolenoid deployable1; | ||
private WsSolenoid deployable2; | ||
|
||
//All variables used | ||
private boolean intakeCall; | ||
|
||
|
||
|
||
@Override | ||
public void inputUpdate(Input source) { | ||
// TODO Auto-generated method stub | ||
|
||
if (source == deployRevIntake){ | ||
intakeCall = !(intakeCall); | ||
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. This is functionally the same but it could just be !intakeCall 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. We should also have the ability to spin the intake backwards |
||
|
||
} | ||
} | ||
|
||
@Override | ||
public void init() { | ||
// TODO Auto-generated method stub | ||
intake1 = (WsSparkMax) WSOutputs.INTAKE1.get(); | ||
|
||
deployRevIntake = (WsJoystickButton) WSInputs.MANIPULATOR_DPAD_DOWN.get(); | ||
deployRevIntake.addInputListener(this); | ||
|
||
deployable1 = (WsSolenoid) WSOutputs.DEPLOYABLE1.get(); | ||
deployable2 = (WsSolenoid) WSOutputs.DEPLOYABLE2.get(); | ||
|
||
intakeCall = false; | ||
|
||
} | ||
|
||
@Override | ||
public void selfTest() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public void update() { | ||
// TODO Auto-generated method stub | ||
if (intakeCall){ | ||
intake1.setValue(1); | ||
deployable1.setValue(true); | ||
deployable2.setValue(true); | ||
} else { | ||
intake1.setValue(0); | ||
deployable1.setValue(false); | ||
deployable2.setValue(false); | ||
} | ||
} | ||
|
||
@Override | ||
public void resetState() { | ||
// TODO Auto-generated method stub | ||
intakeCall = false; | ||
|
||
} | ||
|
||
@Override | ||
public String getName() { | ||
// TODO Auto-generated method stub | ||
return "Deployable"; | ||
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. Rename this to match the class name and add the class to WSSubsystems |
||
} | ||
|
||
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.wildstang.year2023.subsystems; | ||
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. Looks like you had already committed this, I'll remove it |
||
|
||
import org.wildstang.framework.io.inputs.Input; | ||
import org.wildstang.framework.subsystems.Subsystem; | ||
import org.wildstang.hardware.roborio.inputs.WsJoystickAxis; | ||
//import org.wildstang.hardware.roborio.outputs.WsPhoenix; | ||
import org.wildstang.year2023.robot.WSInputs; | ||
import org.wildstang.year2023.robot.WSOutputs; | ||
|
||
/** | ||
* Sample Subsystem that controls a motor with a joystick. | ||
* @author Liam | ||
*/ | ||
public class tankDrive implements Subsystem { | ||
// inputs | ||
WsJoystickAxis joystick; | ||
|
||
// outputs | ||
//WsPhoenix motor; | ||
|
||
// states | ||
double speed; | ||
|
||
|
||
@Override | ||
public void init() { | ||
joystick = (WsJoystickAxis) WSInputs.DRIVER_LEFT_JOYSTICK_Y.get(); | ||
|
||
//motor = (WsPhoenix) WSOutputs.TEST_MOTOR.get(); | ||
|
||
speed = 0; | ||
} | ||
|
||
@Override | ||
public void resetState() { | ||
speed = 0; | ||
} | ||
|
||
@Override | ||
public void update() { | ||
//motor.setValue(speed); | ||
} | ||
|
||
@Override | ||
public void inputUpdate(Input source) { | ||
if (source == joystick) { | ||
speed = joystick.getValue(); | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Sample"; | ||
} | ||
|
||
@Override | ||
public void selfTest() { | ||
} | ||
} |
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.
Lets call this Intake to be more clear