generated from DeepBlueRobotics/EmptyProject2024
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed armteleop so its a defualt command instead of periodic in sub…
…system
- Loading branch information
1 parent
65dc6b6
commit 1496ebd
Showing
3 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/org/carlmontrobotics/commands/ArmTeleop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// 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 org.carlmontrobotics.commands; | ||
|
||
|
||
import java.util.function.DoubleSupplier; | ||
|
||
import edu.wpi.first.wpilibj.XboxController; | ||
import edu.wpi.first.wpilibj2.command.CommandBase; | ||
|
||
|
||
public class ArmTeleop extends CommandBase { | ||
private final DoubleSupplier joystick; | ||
/** Creates a new ArmTeleop. */ | ||
public ArmTeleop(DoubleSupplier joystickSupplier) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
joystick = joystickSupplier; | ||
addRequirements(); | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() {} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() { | ||
double value = joystick.getAsDouble(); | ||
} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) {} | ||
|
||
// Returns true when the command should end. | ||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters