Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple channels in the setup function #7

Open
gvigh opened this issue May 14, 2022 · 0 comments
Open

Support multiple channels in the setup function #7

gvigh opened this issue May 14, 2022 · 0 comments

Comments

@gvigh
Copy link

gvigh commented May 14, 2022

Currently the Mock implementation of setup only allows one channel as it's first parameter.

According to the RPi.GPIO documentation, (and my own testing) the RPi.GPIO setup function supports the initialization of multiple channels with only one call:

chan_list = [11,12]    # add as many channels as you want!
                       # you can tuples instead i.e.:
                       #   chan_list = (11,12)
GPIO.setup(chan_list, GPIO.OUT)

taken from the 'Setup more than one channel' section in the linked docs

This should also work when providing an initial value:

GPIO.setup([11, 12], GPIO.OUT, initial=GPIO.LOW)

Since one of the goals of this project is to make the switching between the two modules seamless, I would recommend fixing this small difference :)

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

No branches or pull requests

1 participant