[wpilib] Replace internal usages of Analog getAverageVoltage (#8271)

This commit is contained in:
Thad House
2025-10-02 22:40:45 -07:00
committed by GitHub
parent e369c721ca
commit 7d34f43e44
4 changed files with 4 additions and 6 deletions

View File

@@ -83,7 +83,7 @@ public class AnalogAccelerometer implements Sendable, AutoCloseable {
if (m_analogChannel == null) {
return 0.0;
}
return (m_analogChannel.getAverageVoltage() - m_zeroGVoltage) / m_voltsPerG;
return (m_analogChannel.getVoltage() - m_zeroGVoltage) / m_voltsPerG;
}
/**

View File

@@ -125,8 +125,7 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
if (m_analogInput == null) {
return m_offset;
}
return (m_analogInput.getAverageVoltage() / RobotController.getVoltage3V3()) * m_fullRange
+ m_offset;
return (m_analogInput.getVoltage() / RobotController.getVoltage3V3()) * m_fullRange + m_offset;
}
@Override