Test Failed
Push — master ( 519662...d9c046 )
by John
04:15 queued 01:23
created

openArms

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
1
package org.usfirst.frc.team3695.robot.subsystems;
2
3
import org.usfirst.frc.team3695.robot.Constants;
4
5
import edu.wpi.first.wpilibj.Solenoid;
6
import edu.wpi.first.wpilibj.command.Subsystem;
7
8
/**
9
 * opens and closes the clamp part of the manipulator
10
 */
11
public class SubsystemClamp extends Subsystem {
12
	private Solenoid openArms;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like openArms. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
13
	private Solenoid closeArms;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like closeArms. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
14
	private boolean open; // current State of arms; true = open, false = closed
15
	
16
	public SubsystemClamp(){
17
		openArms = new Solenoid(Constants.OPEN_ARMS);
18
		closeArms = new Solenoid(Constants.CLOSE_ARMS);
19
		open = false;
20
	}
21
22
    public void initDefaultCommand() {}
23
    
24
    public void openArms(){
25
    	openArms.set(true);
26
    	closeArms.set(false);
27
    	open = true;
28
    }
29
    
30
    public void closeArms(){
31
    	openArms.set(false);
32
    	closeArms.set(true);
33
    	open = false;
34
    }
35
    
36
    public void toggleArms(){
37
    	if (open) closeArms();	else openArms();
38
    }
39
}
40
41