Test Failed
Pull Request — master (#87)
by John
02:05
created

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

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
dl 0
loc 25
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
initDefaultCommand 0 1 ?
A test() 0 8 2
A initDefaultCommand() 0 1 1
redline 0 1 ?
A redline() 0 1 1
A SubsystemArduino() 0 3 1
1
package org.usfirst.frc.team3695.robot.subsystems;
2
3
import edu.wpi.first.wpilibj.I2C;
4
import edu.wpi.first.wpilibj.Timer;
5
import edu.wpi.first.wpilibj.command.Subsystem;
6
import org.usfirst.frc.team3695.robot.Constants;
7
8
//This is all uncertain and if it works will be commented properly later
9
public class SubsystemArduino extends Subsystem {
10
11
    I2C i2c;
12
    byte[] toSend;
13
14
    protected void initDefaultCommand() {}
15
16
    public SubsystemArduino() {
17
        i2c = new I2C(I2C.Port.kOnboard, Constants.I2C_DEVICE_ADDRESS);
18
        toSend = new byte[1];
19
//        test();
20
    }
21
22
    void test(){
23
        while (true){
24
            toSend[0] = 76;
0 ignored issues
show
Comprehensibility introduced by
Consider assigning this magic number 76 to a constant.

Using constants for hard-coded numbers is a best practice. A constant’s name can explain the rationale behind this magic number. It is also easier to find if you ever need to change it.

Loading history...
25
            i2c.transaction(toSend, 1, null, 0);
26
            Timer.delay(1);
27
            toSend[0] = 72;
0 ignored issues
show
Comprehensibility introduced by
Consider assigning this magic number 72 to a constant.

Using constants for hard-coded numbers is a best practice. A constant’s name can explain the rationale behind this magic number. It is also easier to find if you ever need to change it.

Loading history...
28
            i2c.transaction(toSend, 1, null, 0);
29
            Timer.delay(1);
30
        }
31
    }
32
    
33
    public void redline() {
34
    	
35
    }
36
37
38
39
40
}