mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Changed AnalogPotentiometer to use angle specification and rail voltage.
Change-Id: I98f2c1c16726496a69c86174cdb870c74e05822c
This commit is contained in:
@@ -29,7 +29,7 @@ public class AnalogPotentiometerTest extends AbstractComsSetup {
|
||||
private FakePotentiometerSource potSource;
|
||||
private AnalogPotentiometer pot;
|
||||
|
||||
private static final double DOUBLE_COMPARISON_DELTA = 1.0;
|
||||
private static final double DOUBLE_COMPARISON_DELTA = 2.0;
|
||||
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
@@ -38,7 +38,7 @@ public class AnalogPotentiometerTest extends AbstractComsSetup {
|
||||
public void setUp() throws Exception {
|
||||
analogIO = TestBench.getAnalogCrossConnectFixture();
|
||||
potSource = new FakePotentiometerSource(analogIO.getOutput(), 360);
|
||||
pot = new AnalogPotentiometer(analogIO.getInput(), 360.0/5.0, 0);
|
||||
pot = new AnalogPotentiometer(analogIO.getInput(), 360.0, 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public class AnalogPotentiometerTest extends AbstractComsSetup {
|
||||
public void testRangeValues(){
|
||||
for(double i = 0.0; i < 360.0; i = i+1.0){
|
||||
potSource.setAngle(i);
|
||||
potSource.setMaxVoltage(ControllerPower.getVoltage5V());
|
||||
Timer.delay(.02);
|
||||
assertEquals(i, pot.get(), DOUBLE_COMPARISON_DELTA);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user