def setSamplesToAverage(self, samplesToAverage: int) -> None: """Set 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. TODO: Should this raise an exception, so that the user has to deal with giving an incorrect value? :param samplesToAverage: The number of samples to average from 1 to 127. """ hal.setEncoderSamplesToAverage(self.encoder, samplesToAverage)