Bird
0
0

How do you correctly set the GPIO pin numbering mode to BCM in a Python script using RPi.GPIO?

easy📝 Syntax Q3 of 15
Raspberry Pi - GPIO Basics with Python
How do you correctly set the GPIO pin numbering mode to BCM in a Python script using RPi.GPIO?
AGPIO.setmode(GPIO.BCM)
BGPIO.setmode(GPIO.PHYSICAL)
CGPIO.setup(GPIO.BCM)
DGPIO.mode(GPIO.BCM)
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct method

    The method to set pin numbering mode is GPIO.setmode().
  2. Step 2: Use correct constant

    GPIO.BCM is the constant for BCM numbering mode.
  3. Final Answer:

    GPIO.setmode(GPIO.BCM) -> Option A
  4. Quick Check:

    setmode with BCM constant sets BCM numbering [OK]
Quick Trick: Use GPIO.setmode(GPIO.BCM) to select BCM mode [OK]
Common Mistakes:
  • Using GPIO.setup instead of setmode
  • Using incorrect constants like PHYSICAL
  • Calling GPIO.mode which does not exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes