Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

OUTPUT pins also initialize as INPUT pins #25

Open
cchamikara opened this issue Feb 4, 2018 · 1 comment
Open

OUTPUT pins also initialize as INPUT pins #25

cchamikara opened this issue Feb 4, 2018 · 1 comment

Comments

@cchamikara
Copy link

cchamikara commented Feb 4, 2018

I found that output pins also set as input pins by init_gpio() function , so I did modify below lines to get it work

        if pin not in GPIO_OUTPUT_PINS:
            logging.debug("Initialising GPIO input pin %d..." % (pin))
            if MONITOR_PINS_PUD == "UP":
                GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
            elif MONITOR_PINS_PUD == "DOWN":
                GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
            else:
                GPIO.setup(pin, GPIO.IN)
        else:
            logging.debug("Initialising GPIO output pin %d..." % (pin))
            GPIO.setup(pin, GPIO.OUT)
@sumnerboy12
Copy link
Owner

Could you provide this fix as a PR?

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

No branches or pull requests

2 participants