-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Branch for Potentiometers, do not use as voltage information stil…
…l needs to be found
- Loading branch information
1 parent
841b71d
commit 8908f8b
Showing
3 changed files
with
54 additions
and
2 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
28 changes: 28 additions & 0 deletions
28
src/main/java/frc/robot/subsystems/PotentiometerSubsystem.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,28 @@ | ||
package frc.robot.subsystems; | ||
|
||
import edu.wpi.first.wpilibj.AnalogPotentiometer; | ||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import frc.robot.Constants.AutonConstants; | ||
|
||
public class PotentiometerSubsystem { | ||
|
||
private final AnalogPotentiometer LocationPotentiometer = new AnalogPotentiometer(AutonConstants.kAnalogInputPortLoc, AutonConstants.kPotentiometerFullRange, AutonConstants.kPotentiometerOffset); | ||
private final AnalogPotentiometer PathPotentiometer = new AnalogPotentiometer(AutonConstants.kAnalogInputPortPath, AutonConstants.kPotentiometerFullRange, AutonConstants.kPotentiometerOffset); | ||
|
||
public void periodic() { | ||
double locationVoltage = LocationPotentiometer.get(); | ||
double pathVoltage = PathPotentiometer.get(); | ||
SmartDashboard.putNumber("Location Potentiometer", locationVoltage); | ||
SmartDashboard.putNumber("Path Potentiometer", pathVoltage); | ||
} | ||
//TODO: Get values for voltages on the potentiometers so that when the voltage is in x-range or equal to x | ||
//TODO: It will return y-path. right now num is undefined beucase the range is unknown. | ||
public void getPath(double locationVoltage, double pathVoltage){ | ||
double num; | ||
String path; | ||
//if (pathVoltage < num){ | ||
//path = "1-Left-Leave-Delayed-6s"; | ||
//} | ||
} | ||
} | ||
|