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

org.usfirst.frc.team3695.robot.subsystems.SubsystemManipulator   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

9 Methods

Rating   Name   Duplication   Size   Complexity  
eat 0 4 ?
A spit(double) 0 3 1
A initDefaultCommand() 0 1 1
stopSpinning 0 3 ?
spit 0 3 ?
A voltage(TalonSRX) 0 1 1
A stopSpinning() 0 3 1
A eat(double) 0 4 1
A SubsystemManipulator() 0 3 1
1
package org.usfirst.frc.team3695.robot.subsystems;
2
3
import org.usfirst.frc.team3695.robot.Constants;
4
import org.usfirst.frc.team3695.robot.commands.ButtonCommandSpit;
5
import org.usfirst.frc.team3695.robot.commands.ManualCommandDrive;
6
import org.usfirst.frc.team3695.robot.enumeration.Direction;
7
import org.usfirst.frc.team3695.robot.util.Util;
8
import org.usfirst.frc.team3695.robot.util.Xbox;
9
10
import com.ctre.CANTalon;
11
import com.ctre.phoenix.motorcontrol.ControlMode;
12
import com.ctre.phoenix.motorcontrol.can.TalonSRX;
13
14
import edu.wpi.first.wpilibj.Joystick;
15
import edu.wpi.first.wpilibj.command.Subsystem;
16
17
/** VROOM VROOM */
18
public class SubsystemManipulator extends Subsystem {
19
	
20
	
21
	private TalonSRX armLeft;
22
	private TalonSRX armRight;
23
24
	
25
	/** runs at robot boot */
26
    public void initDefaultCommand() {}
27
	
28
	/** gives birth to the CANTalons */
29
    public SubsystemManipulator(){
30
    	armLeft = new TalonSRX(Constants.LEFT_ARM);
31
    	armRight = new TalonSRX(Constants.LEFT_ARM);
32
    }
33
    
34
    /** eat the power cube */
35
    public void eat(double speed) {
36
    	speed *= -1;
37
    	armLeft.set(ControlMode.PercentOutput, speed);
38
    	armRight.set(ControlMode.PercentOutput, speed);
39
    }
40
    
41
    /** spit out the power cube */
42
    public void spit(double speed) {
43
    	armLeft.set(ControlMode.PercentOutput, speed);
44
    	armRight.set(ControlMode.PercentOutput, speed);
45
    }
46
    
47
    /** STOP SPINNING ME RIGHT ROUND, BABY RIGHT ROUND */
48
    public void stopSpinning() {
49
    	armLeft.set(ControlMode.PercentOutput, 0);
50
    	armRight.set(ControlMode.PercentOutput, 0);
51
    }
52
53
    /** configures the voltage of each CANTalon */
54
    private void voltage(TalonSRX talon) {
0 ignored issues
show
Unused Code introduced by
Your method has more parameters than it evaluates. Consider removing talon.
Loading history...
55
    	// talon.configNominalOutputVoltage(0f, 0f);
56
    	// talon.configPeakOutputVoltage(12.0f, -12.0f);
57
    	// talon.enableCurrentLimit(true);
58
    	// talon.configContinuousCurrentLimit(30, 3000);
59
    }
60
    
61
    
62
63
}
64
65