-
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.
- Loading branch information
1 parent
419c44d
commit 371977d
Showing
8 changed files
with
84 additions
and
50 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 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/com/team766/robot/rookie_bot/mechanisms/Elevator.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 com.team766.rookie_bot.mechanisms; | ||
|
||
import com.team766.hal.RobotProvider; | ||
import com.team766.hal.SpeedController; | ||
import com.team766.hal.EncoderReader; | ||
|
||
public class Elevator extends Mechanism{ | ||
private SpeedController m_elevator; | ||
private EncoderReader m_elevatorEncoder; | ||
|
||
public Elevator() { | ||
m_elevator = RobotProvider.instance.getMotor("elevator"); | ||
m_elevatorEncoder = RobotProvider.instance.getEncoder("elevator_encoder"); | ||
resetEncoder(); | ||
} | ||
|
||
public void move(double power){ | ||
m_elevator.set(power); | ||
} | ||
|
||
public double getElevatorDistance(){ | ||
return m_elevatorEncoder.getDistance(); | ||
} | ||
|
||
public void resetEncoder(){ | ||
m_elevatorEncoder.reset(); | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/team766/robot/rookie_bot/procedures/PIDElevator.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,8 @@ | ||
package com.team766.robot.rookie_bot.procedures; | ||
import com.team766.framework.Procedure; | ||
import com.team766.controllers.PIDController; | ||
import com.team766.framework.Context; | ||
import com.team766.robot.rookie_bot.Robot; | ||
|
||
public class PIDElevator { | ||
|
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