Skip to content

Use GPIO BCM mode to allow use of GPIO 0 and 1#98

Open
jackw01 wants to merge 2 commits intomholgatem:masterfrom
jackw01:master
Open

Use GPIO BCM mode to allow use of GPIO 0 and 1#98
jackw01 wants to merge 2 commits intomholgatem:masterfrom
jackw01:master

Conversation

@jackw01
Copy link

@jackw01 jackw01 commented Jan 14, 2025

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.

Copy link
Owner

@mholgatem mholgatem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Successfully merging this pull request may close these issues.

2 participants