Test Failed
Push — master ( d9c046...9db1c9 )
by John
04:04 queued 01:56
created

SubsystemArduino()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 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
}