generated from Evthestrike/Infinite_Recharge_2021
-
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.
- Loading branch information
1 parent
7c0bc67
commit fd85f10
Showing
5 changed files
with
89 additions
and
49 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
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
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
// 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.commands; | ||
|
||
import java.text.RuleBasedCollator; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
import frc.robot.Robot; | ||
import frc.robot.RobotContainer; | ||
|
||
import frc.robot.RobotMap; | ||
|
||
// NOTE: Consider using this command inline, rather than writing a subclass. For more | ||
// information, see: | ||
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html | ||
public class TiltDown extends InstantCommand { | ||
double endPos; | ||
|
||
public TiltDown() { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
endPos = ((RobotContainer.m_tilt.getTiltPosition() / RobotMap.PULSES_PER_DEGREE) - 5) * RobotMap.PULSES_PER_DEGREE; | ||
|
||
if (endPos < RobotMap.MAGAZINE_LOW) { | ||
endPos = RobotMap.MAGAZINE_LOW; | ||
} | ||
if (endPos > RobotMap.MAGAZINE_VERTICAL) { | ||
endPos = RobotMap.MAGAZINE_VERTICAL; | ||
} | ||
|
||
RobotContainer.m_tilt.setTiltAngle(endPos); | ||
} | ||
} |
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,39 @@ | ||
// 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.commands; | ||
|
||
import java.text.RuleBasedCollator; | ||
|
||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
import frc.robot.Robot; | ||
import frc.robot.RobotContainer; | ||
|
||
import frc.robot.RobotMap; | ||
|
||
// NOTE: Consider using this command inline, rather than writing a subclass. For more | ||
// information, see: | ||
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html | ||
public class TiltUp extends InstantCommand { | ||
double endPos; | ||
|
||
public TiltUp() { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
endPos = ((RobotContainer.m_tilt.getTiltPosition() / RobotMap.PULSES_PER_DEGREE) + 5) * RobotMap.PULSES_PER_DEGREE; | ||
|
||
if (endPos < RobotMap.MAGAZINE_LOW) { | ||
endPos = RobotMap.MAGAZINE_LOW; | ||
} | ||
if (endPos > RobotMap.MAGAZINE_VERTICAL) { | ||
endPos = RobotMap.MAGAZINE_VERTICAL; | ||
} | ||
|
||
RobotContainer.m_tilt.setTiltAngle(endPos); | ||
} | ||
} |