When it comes to the Raspberry Pi, building your Pi project starts with a game plan and designing your plan starts with knowing exactly which GPIO pin does what. That’s where tools like our GPIO pinout article or the those offered by Pinout.xyz come into play.
Run by Pimoroni Developer Phil Howard, Pinout.xyz houses all sorts of useful GPIO charts and interactive tools for makers to reference while building their projects. Not only do they have every Raspberry Pi GPIO you can think of, but they also have quite a few pinout charts for Raspberry Pi accessories like HATs, boards, and pHATs.
As April draws to a close, Howard surprised us with a new command line tool that allows you to see the pinout for Raspberry Pi Pico right in your terminal and to query it for specific information. The Python 3-powered application called Picopins can run in the Linux or Windows command lines. You just need to have Python 3 installed.
To install Picopins, use the pip package installer, which comes with most installations of Python 3 or can be install separately.
pip install picopins
If pip alone does not work, try pip3.
When you enter the command picopins, the application loads a lovely chart displaying the Raspberry Pi Pico and its pins. By default, all you see are the basics for each pin: GP number, ground, voltage and ADC.
However, if you enter picopins --all, you get a very detailed listing of what each pin does, including whether it supports I2C, SPA or UART connections. If you add --pins to the argument, you will get the pin numbers as well. We recommend using --pins and --all together.
But that amount of information can be overwhelming. If you just want to find the pins that have a particular function, you can use the --find argument followed by what you're looking for. For example, if you want to highlight the ground pins, enter picopins --find ground and you'll get a result like this.
As of April 30th, the --find argument has been updated to accept regular expressions / wildcards and to search key details such as identifying SPI, I2C or other specifications. For example, if you enter picopins --all --pins --find "scl", you will get output that highlights those pis that have SCL.
If you want to see a complete list of all the command line arguments for picopins, enter picopins --help. To learn even more about this new tool and track its development, head over the official Picopins project page at GitHub. There you can not only see the official source code but find official usage instructions from Howard himself.