public void dispose() { Util.consoleLog(); if (pot != null) pot.free(); if (buttonA != null) buttonA.free(); if (buttonB != null) buttonB.free(); }
public double getPot() { double val = (double) _pot.getAverageValue(); // integer between 3 - 400 double delay = Math.min((val / 400), 10.0); // number between 0 and 10 return delay; }
/* * (non-Javadoc) *$ * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#teardown() */ @Override public boolean teardown() { input.free(); output.free(); return true; }
/** * Gets current value of the potentiometer. * * @return Integer value of pot. */ public int getPotValue() { return pot.getValue(); }
/** @return The distance to the obstacle detected by the rangefinder. */ public double getDistanceToObstacle() { // Really meters in simulation since it's a rangefinder... return rangefinder.getAverageVoltage(); }