Bird
0
0

Which of the following is the correct way to set GPIO pin numbering to BCM mode in Python?

easy📝 Syntax Q12 of 15
Raspberry Pi - GPIO Basics with Python
Which of the following is the correct way to set GPIO pin numbering to BCM mode in Python?
AGPIO.setmode(GPIO.BOARD)
BGPIO.setupmode(GPIO.BCM)
CGPIO.mode(GPIO.BCM)
DGPIO.setmode(GPIO.BCM)
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct function to set GPIO mode

    The function to set numbering mode is GPIO.setmode().
  2. Step 2: Use the correct constant for BCM mode

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

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

    Use setmode with BCM constant [OK]
Quick Trick: Use GPIO.setmode(GPIO.BCM) to select BCM numbering [OK]
Common Mistakes:
  • Using GPIO.mode instead of GPIO.setmode
  • Using BOARD instead of BCM constant
  • Calling GPIO.setupmode which doesn't exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes