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

Running failed setup() before setmode() results in subsequent setup() call failing due to pin "being in use" #56

Open
theyoyojo opened this issue Feb 24, 2022 · 1 comment

Comments

@theyoyojo
Copy link
Contributor

>>> GPIO.setup(40, GPIO.OUTPUT)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'RPi.GPIO' has no attribute 'OUTPUT'
>>> GPIO.setup(40, GPIO.OUT)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rpi/RPi.GPIO2/RPi/core.py", line 1098, in setup
    channel[i] = channel_fix_and_validate(channel[i])
  File "/home/rpi/RPi.GPIO2/RPi/core.py", line 351, in channel_fix_and_validate
    raise RuntimeError("Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)")
RuntimeError: Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)
>>> GPIO.setmode(GPIO.BOARD)
>>> GPIO.setup(40, GPIO.OUT)
/home/rpi/RPi.GPIO2/RPi/core.py:1109: UserWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
                     Further attemps to use channel 21 will fail unless setup() is run again sucessfully
  warn("This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.\n \
>>> GPIO.setup(40, GPIO.OUT)
@theyoyojo
Copy link
Contributor Author

Or maybe the warning is just wrong. Not sure

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