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

[Question]: Set GPIO.mode Via RFDevice Constructor #70

Open
hasenradball opened this issue Apr 13, 2023 · 0 comments
Open

[Question]: Set GPIO.mode Via RFDevice Constructor #70

hasenradball opened this issue Apr 13, 2023 · 0 comments

Comments

@hasenradball
Copy link

hasenradball commented Apr 13, 2023

@milaq Hi,

I would like to enhance the constructor in that way, that I can define during construction if the mode BCM or BOARD is used.
Is this possible?

Kind of like this
see PR: #71

def __init__(self, pin, mode, tx_proto=1, tx_pulselength=None, tx_repeat=10, tx_length=24, rx_tolerance=80):

self.pin = pin

if (mode.upper() == 'BCM'):
      GPIO.setmode(GPIO.BCM)
      _LOGGER.debug("Using GPIO Pin " + str(pin))
elif (mode.upper() == 'BOARD'):
    GPIO.setmode(GPIO.BOARD)
      _LOGGER.debug("Using Board Pin " + str(pin))
....

Regards Frank

@hasenradball hasenradball changed the title [Question]: regarding set GPIO.mode via RFDevice constructor [Question]: Set GPIO.mode Via RFDevice Constructor Apr 16, 2023
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