Class PowerDistribution

    • Constructor Detail

      • PowerDistribution

        public PowerDistribution()
        Constructs a PowerDistribution.

        Uses the default CAN ID (0 for CTRE and 1 for REV).

    • Method Detail

      • getNumChannels

        public int getNumChannels()
        Gets the number of channel for this power distribution.
        Returns:
        Number of output channels.
      • getVoltage

        public double getVoltage()
        Query the input voltage of the PDP.
        Returns:
        The voltage of the PDP in volts
      • getTemperature

        public double getTemperature()
        Query the temperature of the PDP.
        Returns:
        The temperature of the PDP in degrees Celsius
      • getCurrent

        public double getCurrent​(int channel)
        Query the current of a single channel of the PDP.
        Parameters:
        channel - The PDP channel to query.
        Returns:
        The current of one of the PDP channels (channels 0-15) in Amperes
      • getTotalCurrent

        public double getTotalCurrent()
        Query the current of all monitored PDP channels (0-15).
        Returns:
        The current of all the channels in Amperes
      • getTotalPower

        public double getTotalPower()
        Query the total power drawn from the monitored PDP channels.
        Returns:
        the total power in Watts
      • getTotalEnergy

        public double getTotalEnergy()
        Query the total energy drawn from the monitored PDP channels.
        Returns:
        the total energy in Joules
      • resetTotalEnergy

        public void resetTotalEnergy()
        Reset the total energy to 0.
      • getModule

        public int getModule()
        Gets module number (CAN ID).
        Returns:
        The module number (CAN ID).