0

I know about the two modes of working in Pi using python, Board and BCN. However, I am really confused as to the instances or situations where I should use them.

An example demonstrating their use would really be helpful.

0

There are at least three incompatible GPIO numbering systems used on the Pi.

  • Broadcom GPIO number (BCM). The GPIO is identified by the number that is used by Broadcom (the SoC manufacturer)
  • Board. The GPIO number is identified by the pin it is attached to on the expansion header.
  • wiringPi. The GPIO are named in a somewhat arbitrary sequence.

Most GPIO libraries will support one or two numbering schemes.

It does not matter which numbering scheme you use as long as it is supported by the software you are using.

I would recommend using Broadcom numbering as it is the one most widely used.

For examples see https://elinux.org/RPi_GPIO_Code_Samples

For reference the popular Python GPIO libraies are as follows.

  • RPi.GPIO - board and Broadcom
  • RPIO.GPIO - board and Broadcom
  • wiringPi - wiringPi and Broadcom
  • pigpio - Broadcom
  • gpiozero - Broadcom

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.