1

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

Chris V.
  • 11
  • 1

2 Answers2

6

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
  • 71,852
  • 5
  • 76
  • 108
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
  • 62,573
  • 32
  • 113
  • 225