Пример #1
0
    def setMaxPeriod(self, maxPeriod: float) -> None:
        """Sets the maximum period for stopped detection. Sets the value that
        represents the maximum period of the Encoder before it will assume
        that the attached device is stopped. This timeout allows users to
        determine if the wheels or other shaft has stopped rotating. This
        method compensates for the decoding type.

        :param maxPeriod: The maximum time between rising and falling edges
            before the FPGA will report the device stopped. This is expressed
            in seconds.
        """
        hal.setEncoderMaxPeriod(self.encoder, maxPeriod)
Пример #2
0
    def setMaxPeriod(self, maxPeriod: float) -> None:
        """Sets the maximum period for stopped detection. Sets the value that
        represents the maximum period of the Encoder before it will assume
        that the attached device is stopped. This timeout allows users to
        determine if the wheels or other shaft has stopped rotating. This
        method compensates for the decoding type.

        :param maxPeriod: The maximum time between rising and falling edges
            before the FPGA will report the device stopped. This is expressed
            in seconds.
        """
        hal.setEncoderMaxPeriod(self.encoder, maxPeriod)
Пример #3
0
    def setMaxPeriod(self, maxPeriod):
        """Sets the maximum period for stopped detection. Sets the value that
        represents the maximum period of the Encoder before it will assume
        that the attached device is stopped. This timeout allows users to
        determine if the wheels or other shaft has stopped rotating. This
        method compensates for the decoding type.

        :param maxPeriod: The maximum time between rising and falling edges
            before the FPGA will report the device stopped. This is expressed
            in seconds.
        """
        if self.counter is not None:
            self.counter.setMaxPeriod(maxPeriod * self.decodingScaleFactor())
        elif self.encoder is not None:
            hal.setEncoderMaxPeriod(self.encoder, maxPeriod)
        else:
            raise ValueError("operation on freed port")
Пример #4
0
    def setMaxPeriod(self, maxPeriod):
        """Sets the maximum period for stopped detection. Sets the value that
        represents the maximum period of the Encoder before it will assume
        that the attached device is stopped. This timeout allows users to
        determine if the wheels or other shaft has stopped rotating. This
        method compensates for the decoding type.

        :param maxPeriod: The maximum time between rising and falling edges
            before the FPGA will report the device stopped. This is expressed
            in seconds.
        """
        if self.counter is not None:
            self.counter.setMaxPeriod(maxPeriod * self.decodingScaleFactor())
        elif self.encoder is not None:
            hal.setEncoderMaxPeriod(self.encoder, maxPeriod)
        else:
            raise ValueError("operation on freed port")