Total Complexity | 5 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package org.usfirst.frc.team3695.robot.subsystems; |
||
7 | public class SubsystemCompressor extends Subsystem { |
||
8 | |||
9 | |||
10 | Compressor comp = new Compressor(); // initialize compressor |
||
11 | |||
12 | public void initDefaultCommand() {} |
||
13 | |||
14 | /** return compressor state */ |
||
15 | public boolean isEnabled(){ |
||
16 | return comp.enabled(); |
||
17 | } |
||
18 | |||
19 | /** enable/disable compressor */ |
||
20 | public void setState(boolean state){ |
||
|
|||
21 | if (state) comp.start(); else comp.stop(); |
||
22 | } |
||
23 | |||
24 | /** blindly change the state to !state */ |
||
25 | public void toggle(){ |
||
26 | setState(!isEnabled()); |
||
27 | } |
||
30 |