0
  1. I use wiringPi to define pins in my code1.
  2. Then I have code2 (not relevant to the code1) use the default pin definition (the state of pins after start or reboot). I want to run code 2, so that I have to reboot Pi to reset pin setup.

Are there any ways to reset pin setup by command line? Thank you for reading.

  • 1
    "use default pin definition in Raspbian (bcm for linux)" -> That's not the Raspbian default. That's the default period; BCM is for Broadcom, not linux. It's based on the SoC, but the pin arrangement on the Pi breakout is irregular hence there's also the "physical" numbering scheme, which is based on the breakout -- but the breakout is really an abstraction programming wise, so I am not sure that your question makes sense. Please clarify by explaining what context you need this "reset" to apply to. – goldilocks May 15 '17 at 10:43
  • Sorry my English is not good. I edited the question, can you check if is clear enough? – Thang Nguyen May 15 '17 at 14:19
0

Are there any ways to reset pin setup by command line?

No, because the pin schema is not set system wide. It is set essentially per process; when you initialize a GPIO library, you may have the alternative to specify a scheme that will be used in the code (strictly then it isn't even really per process; it's just an artifact of compilation).

Different command line tools may also allow for different schemes, but this is not because the scheme is set anywhere other than in the tool itself.

Then I have code2 (not relevant to the code1) use the default pin definition (the state of pins after start or reboot). I want to run code 2, so that I have to reboot Pi to reset pin setup

You should use the GPIO library API to set the scheme you want to use in code 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.