Code:
package edu.wpi.first.wpilibj.Robot2011;
import edu.wpi.first.wpilibj.Robot2011.Actuate.*;
import edu.wpi.first.wpilibj.Robot2011.Calculate.*;
import edu.wpi.first.wpilibj.Robot2011.Perceive.*;
/**
*
* @author davidthefat
*/
public class Robot
{
private ArcadeDriveCalculation ArcadeDrive;
private DataStructure Data;
private Drive Arcade;
private CVJoystick JoyManager;
//Start Test Variables
private CVEncoder e1;
//End Test Variables
public Robot()
{
ArcadeDrive = new ArcadeDriveCalculation();
Arcade = new Drive();
Data = new DataStructure();
JoyManager = new CVJoystick();
}
public void RunTeleop()
{
JoyManager.update(Data);
ArcadeDrive.Calculate(Data);
Arcade.setMotors(Data);
}
//Use these test functions to test whatever you need
public void test()
{
e1.update(Data);
}
public void testInit()
{
e1 = new CVEncoder(1,6);
e1.setDiameter(11.1);
}
}
That is how I code. I never understood commenting obvious things, but everything seems obvious to me. Its like "thanks captain obvious".
Edit: why the CVEncoder takes in 2 variables is because the new kid made it take in indices for a 2d array to handle the encoder channel. So it is very inefficient. Do not judge.