2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00
dent/Subsystems/Elevator.cpp

24 lines
530 B
C++
Raw Normal View History

2015-01-16 19:29:55 -05:00
#include "Elevator.h"
#include "../RobotMap.h"
2015-01-19 12:08:25 -05:00
Elevator::Elevator()/* : PIDSubsystem("Elevator", kP_real, kI_real, 0.0)*/{
2015-02-02 18:53:02 -05:00
motor=new CANTalon(0);
elevatorEncoder=new Encoder(0,1,false);
offset=0;
height=0;
2015-01-17 12:21:16 -05:00
//SetAbsoluteTolerance(0.004);
2015-01-16 19:29:55 -05:00
}
2015-01-17 12:21:16 -05:00
void Elevator::InitDefaultCommand(){
2015-01-16 19:29:55 -05:00
}
2015-01-16 20:46:58 -05:00
void Elevator::Run(double power){
2015-02-02 18:53:02 -05:00
motor->Set(power);
2015-01-16 20:46:58 -05:00
}
void Elevator::SetOffset(double ht){
offset=ht;
}
void Elevator::ResetEncoder(){
elevatorEncoder->Reset();
}
double Elevator::GetHeight(){
return elevatorEncoder->Get()+offset;
}