Raspberry Pi physical computing library GPIO Zero gets an upgrade to v1.5 – includes physical pin numbering!

Ben Nuttall over at Raspberry Pi has announced the release of GPIO Zero 1.5. This is a significant release and includes several enhancements.

  • Improvements to the DistanceSensor class giving more accurate and reliable readings.
  • Improvements to the source/value functionality meaning you could just do: led.source = button to have a button activate an LED.
  • Improvements to the pinout command so you can pass the -x or –xyz argument to show the pinout.xyz website in your browser.
  • Support for more boards, including Jam HAT, PumpkinPi, PiHutXmasTree and TonalBuzzer classes.
  • Better handling of accidents.
  • Support for physical pins. This is something several of us have championed for a while. It’s not perfect but it does solve the problem in terms of specifying pins for inputs and outputs. To use physical pin numbering, just use the BOARD prefix when defining pin usage. For example, instead of led = LED(17), you would do led = LED('BOARD11'). Note the quotes round the BOARD declaration – they’re important! There is also support for the WiringPi way of numbering – use the prefix WP.
    This is very welcome, so thanks Ben and Dave for listening to the community! 🙂

You can upgrade to the latest version by putting the following commands into a Terminal on your Raspberry Pi:

sudo apt update
sudo apt install python3-gpiozero python-gpiozero

If you still haven’t started to use GPIO Zero and want to see what the differences are between RPi.GPIO and this newer, easier-to-use library, take a look here.

Read the official announcement over at Raspberry Pi or delve into the ChangeLog to see all the enhancements.

1 comment for “Raspberry Pi physical computing library GPIO Zero gets an upgrade to v1.5 – includes physical pin numbering!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.