def getAccumulatorOutput(self) -> AccumulatorResult: """Read the accumulated value and the number of accumulated values atomically. This function reads the value and count from the FPGA atomically. This can be used for averaging. """ if not self.isAccumulatorChannel(): raise IndexError("Channel %d is not an accumulator channel." % self.channel) (value, count) = hal.getAccumulatorOutput(self.port) return AccumulatorResult(value + self.accumulatorOffset, count)
def getAccumulatorOutput(self): """Read the accumulated value and the number of accumulated values atomically. This function reads the value and count from the FPGA atomically. This can be used for averaging. :returns: tuple of (value, count) """ if not self.isAccumulatorChannel(): raise IndexError("Channel %d is not an accumulator channel." % self.channel) return hal.getAccumulatorOutput(self.port)