mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Fix PowerDistribution.GetAllCurrents() (#6025)
This commit is contained in:
@@ -113,6 +113,17 @@ public class PowerDistribution implements Sendable, AutoCloseable {
|
||||
return PowerDistributionJNI.getChannelCurrent(m_handle, channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query all currents of the PDP.
|
||||
*
|
||||
* @return The current of each channel in Amperes
|
||||
*/
|
||||
public double[] getAllCurrents() {
|
||||
double[] currents = new double[getNumChannels()];
|
||||
PowerDistributionJNI.getAllCurrents(m_handle, currents);
|
||||
return currents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query the current of all monitored channels.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user