This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
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.
we worked on PID elevator again in a new way.
- Loading branch information
Driver Station Computer
committed
Dec 15, 2024
1 parent
f6e5efd
commit 14ed720
Showing
3 changed files
with
32 additions
and
3 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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/team766/robot/candle_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,23 @@ | ||
package com.team766.robot.candle_bot.mechanisms; | ||
|
||
import com.team766.framework.Mechanism; | ||
import com.team766.hal.MotorController; | ||
import com.team766.hal.RobotProvider; | ||
|
||
public class Elevator extends Mechanism{ | ||
private MotorController elevatormotor; | ||
|
||
public Elevator(){ | ||
elevatormotor = RobotProvider.instance.getMotor("Elevator.elevatormotor"); | ||
elevatormotor.setSensorPosition(0); | ||
} | ||
public void setPosition(double position) { | ||
checkContextOwnership(); | ||
elevatormotor.set(MotorController.ControlMode.Position, position); | ||
} | ||
public void run(){ | ||
log("elevator encoder: " + elevatormotor.getSensorPosition()); | ||
} | ||
|
||
} | ||
|