0

So far, my ignorance was bliss.
I was able to control the GPIO pins and for many years, the world made sense to me
But then I saw this: enter image description here

And wires got crossed in my brain

Why does it say that GPIO7 is at pin 7 of the 40pin connector, while this documentation https://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/ says that GPIO7 is at pin 26 ? (and that is how I have been using it for years)

Are those two different "standards"? and which one is to be used when?

PS: I'm running Raspbian GNU/Linux 11 (bullseye)on a rpi4

thank you for helping to get my sanity back
chrisV

2 Answers2

4

GPIO.7 is the wiringPi name for GPIO 4.

There are three naming schemes in common use.

  • Broadcom numbers. These are the GPIO numbers used by the manufacturer and are the ones used by the operating system.
  • Pin numbers. If a GPIO is routed out to the expansion header it may sometimes be referred to by pin number. E.g. GPIO 4 is connected to pin 7.
  • wiringPi numbers. These are the numbers used to identify the GPIO when using the wiringPi library.

I suggest you stick to using Broadcom numbers.

See https://pinout.xyz/

joan
  • 67,803
  • 5
  • 67
  • 102
  • Thank you @joan for your answer. It makes a little more sense now. – Chris V. Aug 05 '22 at 05:21
  • Adding: That `wiring pi` scheme seems also be used by the python library `RPi.GPIO` (`import RPi.GPIO as GPIO`) Too bad that both "standards" are referring to it as plain `GPIO`. We have miles and kilometers and Pounds and Kilograms, but at least those have a different name. – Chris V. Aug 05 '22 at 05:44
  • RPi.GPIO uses Broadcom numbering (BCM) or pin numbering (BOARD). It does not use wiringPi numbering. – joan Aug 05 '22 at 07:44
2

When WiringPi was initially released in 2013 Gordon used 'wiring' pin numbers to make it similar to Arduino.

This probably seemed like a good idea at the time, but has since caused considerable confusion.

The Pi only understands BCM numbers; programs which use Board (or other) numbers have to translate to BCM numbers.

When WiringPi was deprecated I wrote a GPIOreadall replacement for the wiringpi gpio readall utility. This uses BCM (and Board) numbers and has a few enhancements.
GPIOreadall can be downloaded from https://github.com/Milliways2/GPIOreadall

Milliways
  • 54,718
  • 26
  • 92
  • 182