raiseHook
last analyzed

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 edu.wpi.first.wpilibj.Solenoid;
4
import edu.wpi.first.wpilibj.command.Subsystem;
5
import org.usfirst.frc.team3695.robot.Constants;
6
7
/** VROOM VROOM */
8
public class SubsystemHook extends Subsystem {
9
	
10
	
11
	private Solenoid raiseHook;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like raiseHook. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
12
	private Solenoid lowerHook;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like lowerHook. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
13
	private boolean raised; // current State of arms; true = open, false = closed
14
	
15
	/** runs at robot boot */
16
    public void initDefaultCommand() {}
17
	
18
	/** gives birth to the CANTalons */
19
    public SubsystemHook(){
20
    	raiseHook = new Solenoid(Constants.RAISE_HOOK);
21
		lowerHook = new Solenoid(Constants.LOWER_HOOK);
22
		raised = false;
23
    }
24
   
25
	    public void raiseHook(){
26
	    	lowerHook.set(false);
27
	    	raiseHook.set(true);
28
	    	raised = true;
29
	    }
30
	    
31
	    public void lowerHook(){
32
	    	raiseHook.set(false);
33
	    	lowerHook.set(true);
34
	    	raised = false;
35
	    }
36
	    
37
	    public void toggleHook(){
38
	    	if (raised) lowerHook();	else raiseHook();
39
	    }    
40
    
41
42
}
43
44