Use GPIO BCM mode to allow use of GPIO 0 and 1#98
Open
jackw01 wants to merge 2 commits intomholgatem:masterfrom
Open
Use GPIO BCM mode to allow use of GPIO 0 and 1#98jackw01 wants to merge 2 commits intomholgatem:masterfrom
jackw01 wants to merge 2 commits intomholgatem:masterfrom
Conversation
mholgatem
requested changes
Jan 16, 2025
Owner
mholgatem
left a comment
There was a problem hiding this comment.
I used to use BCM, but it caused a lot of user related problems. This program tends to skew more towards beginners. I wouldn't be opposed to re-implementing it, but I think that what we need to do is add a flag that the user can set. We should default to board, but they can set BCM if they would prefer. You will want to check out the file usr-bin-gpionext, for creating a flag. Then in gpionext.py, you will want to add a parser argument that can receive that flag and pass it on to gpio.py. We should probably also create a function that does a check, if they have already configured using BCM or BOARD and then they change modes, it should clear the entries and prompt them to run config.
TODO:
- implement flag in usr-bin-gpionext
- default to BOARD mode
- when flag is SET/UNSET, clear entries, prompt for new configuration
- add argparse argument to gpionext.py to handle new flag
- pass new argument to gpio.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rpi.GPIO is being used in BOARD mode, which doesn't allow BCM pins 0 and 1 (board pins 27 and 28) to be used. Changing it to BCM mode resolves this issue. Some existing Raspberry pi-based emulator hardware (ex: Mintypi) have buttons connected to these pins.