Skip to content

DigitalInputDevice pull-up pull_down #149

@Bob-May

Description

@Bob-May

The picozero DigitalInputDevice class allows for the pull_up method to be set as follows from the documentation:

:param bool pull_up:
If :data:True, the device will be pulled up to HIGH.
If :data:False (the default), the device will be pulled down to LOW.

Contrast this to the MicroPython machine.Pin class:

pull specifies if the pin has a (weak) pull resistor attached, and can be one of:
None - No pull up or down resistor.
Pin.PULL_UP - Pull up resistor enabled.
Pin.PULL_DOWN - Pull down resistor enabled.

Thus machine.Pin allows for the explicit use of an external pull_up or pull_down resistor, whereas DigitalInputDevice forces an external resistor to be in parallel with the internal resistor.

Was this an intentional choice?

Please consider adding the None case to DigitalInputDevice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions