def getSamplesToAverage(self) -> int: """Get the Samples to Average which specifies the number of samples of the timer to average when calculating the period. Perform averaging to account for mechanical imperfections or as oversampling to increase resolution. :returns: The number of samples being averaged (from 1 to 127) """ return hal.getEncoderSamplesToAverage(self.encoder)
def getSamplesToAverage(self): """Get the Samples to Average which specifies the number of samples of the timer to average when calculating the period. Perform averaging to account for mechanical imperfections or as oversampling to increase resolution. :returns: The number of samples being averaged (from 1 to 127) """ if self.encodingType.value == self.EncodingType.k4X: return hal.getEncoderSamplesToAverage(self.encoder) elif self.encodingType in (self.EncodingType.k2X, self.EncodingType.k1X): return self.counter.getSamplesToAverage() else: return 1