Class CoulombCounter


  • public class CoulombCounter
    extends java.lang.Object
    A software sensor for measuring electric discharge
    • Constructor Detail

      • CoulombCounter

        public CoulombCounter​(CurrentSensor sensor)
        Default constructor
        Parameters:
        sensor - the current sensor which measures battery current
      • CoulombCounter

        public CoulombCounter​(CurrentSensor sensor,
                              Clock clock)
        Test constructor
        Parameters:
        sensor - the current sensor which measures battery current
        clock - the clock to use
    • Method Detail

      • update

        public void update()
        Update the current and total amp-hours. Should be called regularly.
      • getCurrentDischarge

        public double getCurrentDischarge()
        Get the current discharge in Amp-hours (Ah)
        Returns:
        the current electrical discharge
      • getTotalDischarge

        public double getTotalDischarge()
        Get the total discharge in Amp-hours (Ah)
        Returns:
        the total electrical discharge