-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVacuum.cpp
48 lines (40 loc) · 977 Bytes
/
Vacuum.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "Vacuum.h"
#include "CANJaguar.h"
#include "WPILib.h"
#include "Input.h"
#include "CodeLevel.h"
#include "RedAlertJaguar.h"
Vacuum::Vacuum()
{
}
void Vacuum::initVac(UINT8 wutJag,Input*in){
this->input = in;
vacuumJag = new CANJaguar(wutJag,CANJaguar::kPercentVoltage);
/*vacuumJag = new RedAlertJaguar(wutJag, CANJaguar::kPercentVoltage,
GetLevel() == 66 ? RedAlertJaguar::kStub : RedAlertJaguar::kCANJaguar); */
vacuumJag->SetVoltageRampRate(3.0);
}
void Vacuum::suck() {
if (input->shouldFullSuck()==true) {
fullPower();
} else {
zeroPower();
}
}
void Vacuum::fullPower(){
vacuumJag->Set(1);
}
void Vacuum::halfPower(){
vacuumJag->Set(.5);
}
void Vacuum::zeroPower(){
vacuumJag->Set(0);
}
void userControl(int power){
}
float Vacuum::GetCurrent() {
return vacuumJag->GetOutputCurrent();
}
bool Vacuum::checkPosession(){
return (vacuumJag->Get() > 0) && (this->GetCurrent() < 9);
}