Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Document the use of Partials to define types of GPIOPin #268

Open
trickeydan opened this issue Apr 29, 2019 · 1 comment
Open

Document the use of Partials to define types of GPIOPin #268

trickeydan opened this issue Apr 29, 2019 · 1 comment
Labels
documentation Documentation

Comments

@trickeydan
Copy link
Contributor

For example:

from functools import partial

ArduinoDigitalPin = partial(GPIOPin, initial_mode=GPIOPin.DIGITAL_OUTPUT, supported_modes={GPIOPin.DIGITAL_OUTPUT, GPIOPin.DIGITAL_INPUT, GPIOPin.DIGITAL_INPUT_PULLUP}, backend=MyBackend)

pins: List[GPIOPin] = []
for i in range(0,13):
    pins[i] = ArduinoDigitalPin(i)
@trickeydan trickeydan added the documentation Documentation label Apr 29, 2019
@trickeydan trickeydan added this to the v0.5.0 milestone May 7, 2019
@trickeydan trickeydan removed this from the v0.5.0 milestone Jun 9, 2019
@trickeydan
Copy link
Contributor Author

This should probably be done along with #50

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Documentation
Projects
None yet
Development

No branches or pull requests

1 participant