Sitelet https://github.com/gpiozero/gpiozero/issues/1209
Skip to content

Allow sub-integer duty cycle percentage for LGPIOPin #1209

Description

@tplaysted

Currently, the method _set_state(value) of LGPIOPin forces the input duty cycle to a whole percentage:

self._pwm = (freq, int(value * 100))

This leads to poor angular resolution when trying to use a Servo instance with a LGPIO pin factory.

Simply removing call to int() should improve performance:

self._pwm = (freq, value * 100)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions