Menu

#52 'Unallocate' a pin

Done
None
Medium
Enhancement
2014-04-21
2013-12-26
Ben Croston
No

Requested by @cymplecy
Will add GPIO.NONE as well as GPIO.IN and GPIO.OUT for GPIO.setup() calls

Discussion

  • Ben Croston

    Ben Croston - 2013-12-26

    Si - do you want it to clean up the pin when you GPIO.setup(channel, GPIO.NONE) i.e. return the channel to INPUT and remove pullup/down and any events?
    Alternative - RPi.GPIO leaves the pin as configured and just 'forgets' about it (like when you don't run cleanup() ).

     
  • Simon Walters

    Simon Walters - 2014-01-04

    Yes - return it to state it would have been in had it never been used for anything please :)

     
  • Ben Croston

    Ben Croston - 2014-01-04

    So GPIO.cleanup(channel) call then?

     
  • Ben Croston

    Ben Croston - 2014-01-04

    GPIO.cleanup(channel) fix now in source code library. Will be part of next release. I will make the next release as soon as you have tested this fix.

    To install the dev version with this fix:
    $ sudo apt-get remove python-rpi.gpio python3-rpi.gpio
    $ sudo apt-get install python-pip python3-pip python-dev python3-dev
    $ mkdir ~/temp
    $ cd ~/temp
    $ sudo pip-2.7 install -e hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
    $ sudo pip-3.2 install -e hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO

    To remove the dev version and switch back to the Raspbian default version:
    $ sudo pip-2.7 uninstall RPi.GPIO
    $ sudo pip-3.2 uninstall RPi.GPIO
    $ sudo apt-get install python-rpi.gpio python3-rpi.gpio

     
  • Ben Croston

    Ben Croston - 2014-01-04
    • status: Accepted --> Started
     
  • Ben Croston

    Ben Croston - 2014-04-21
    • status: Started --> Done
     
  • Ben Croston

    Ben Croston - 2014-04-21

    In release 0.5.5 - issue closed

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.