Skip to content

Commit

Permalink
Merge pull request #10 from Team4334/Jacob
Browse files Browse the repository at this point in the history
Added debug function to Robot.java
  • Loading branch information
ZephyrAAAA authored Feb 7, 2019
2 parents 1265f22 + c640f3d commit 0ab4320
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,20 @@ else if(gunnerStick.getRawButton(6)) {
driveTrain.arcadeDrive(driveStick.getRawAxis(1), driveStick.getRawAxis(4), true);
}

/**
* This function is called periodically during test mode.
*/
@Override
public void testPeriodic() {

//Debug function to print strings to console and/or SmartDashboard
public static void debugOut(String value, int logLevel, String key) {
switch (logLevel) {
case 0:
System.out.println(value);

case 1:
SmartDashboard.putString(key, value);

default:
break;
}
}
public static void debugOut(String value, int logLevel) {debugOut(value, logLevel, "log");}
public static void debugOut(String value) {debugOut(value, 0);}
}

0 comments on commit 0ab4320

Please sign in to comment.