Completed
Push — master ( 6b018e...519662 )
by John
33s
created

org.usfirst.frc.team3695.robot.commands.ButtonCommandSpit   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
dl 0
loc 24
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A isFinished() 0 2 1
A interrupted() 0 2 1
A end() 0 2 1
A execute() 0 1 1
A ButtonCommandSpit() 0 2 1
A initialize() 0 2 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import org.usfirst.frc.team3695.robot.Constants;
4
import org.usfirst.frc.team3695.robot.Robot;
5
import org.usfirst.frc.team3695.robot.enumeration.Direction;
6
import org.usfirst.frc.team3695.robot.util.Util;
7
8
import edu.wpi.first.wpilibj.command.Command;
9
10
/**
11
 * Commands the gear flaps
12
 */
13
public class ButtonCommandSpit extends Command {
14
	
15
	Direction direction;
16
	
17
    public ButtonCommandSpit() {
18
        requires(Robot.SUB_MANIPULATOR);
19
    }
20
21
    protected void initialize() {
22
    	Robot.SUB_MANIPULATOR.spit(Util.getAndSetDouble("Spinning Speed", Constants.SPINNY_SPEED));
23
    }
24
25
    protected void execute() {}
26
27
    protected boolean isFinished() {
28
        return false;
29
    }
30
31
    protected void end() {
32
    	Robot.SUB_MANIPULATOR.stopSpinning();
33
    }
34
35
    protected void interrupted() {
36
    	end();
37
    }
38
}
39