-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPixyI2C.java
More file actions
68 lines (60 loc) · 2.17 KB
/
Copy pathPixyI2C.java
File metadata and controls
68 lines (60 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package frc.robot;
// import edu.wpi.first.wpilibj.IterativeRobot;
// import edu.wpi.first.wpilibj.Joystick;
// import edu.wpi.first.wpilibj.drive.MecanumDrive;
// import edu.wpi.first.wpilibj.XboxController;
// import com.ctre.phoenix.motorcontrol.can.*;
// import edu.wpi.first.wpilibj.DriverStation;
// import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
// import edu.wpi.first.networktables.NetworkTable;
// import edu.wpi.first.networktables.NetworkTableEntry;
// import edu.wpi.first.networktables.NetworkTableInstance;
// import edu.wpi.first.wpilibj.PIDController;
// import edu.wpi.first.wpilibj.I2C;
// import edu.wpi.first.wpilibj.I2C.Port;
// import edu.wpi.first.wpilibj.command.Subsystem;
// /*public class PixyI2C {
// PixyPacket values;
// I2C pixy;
// Port port = Port.kOnboard;
// PixyException pExc;
// String print;
// public PixyI2C
// {
// pixy = new I2C(port, 0x54);
// packets = new PixyPacket[7];
// pExc = new PixyException(print);
// values = new PixyPacket();
// }
// public PixyI2C(I2C argPixy, PixyPacket[] argPixyPacket, PixyException argPixyException, PixyPacket argValues)
// {
// pixy = argPixy;
// packets = argPixyPacket;
// pExc = argPixyException;
// values = argValues;
// }
// public int cvt(byte upper, byte lower)
// {
// return (((int)upper & 0xff) << 8) | ((int)lower & 0xff);
// }
// public PixyPacket readPacket(int Signature) throws PixyException
// {
// int Checksum;
// int Sig;
// byte[] rawData = new byte[32];
// SmartDashboard.putString("rawData", rawData[0]+ " " + rawData[1] + " " + rawData[15] + " " + rawData[31]);
// try
// {
// pixy.readOnly(rawData, 32);
// }
// catch(RuntimeException e)
// {
// SmartDashboard.putString("Pixy RuntimeException", "Error");
// }
// if(rawData.length < 32)
// {
// System.out.println("byte array length is broken");
// return null;
// }
// }
// }