Raspberry Pi - GPIO Basics with PythonWhich of the following is the correct way to set the GPIO pin numbering mode to use the physical pin numbers?AGPIO.setmode(GPIO.BCM)BGPIO.setmode(GPIO.PHYSICAL)CGPIO.setmode(GPIO.BOARD)DGPIO.setmode(GPIO.PIN)Check Answer
Step-by-Step SolutionSolution:Step 1: Recall pin numbering modes in RPi.GPIOGPIO.BOARD uses physical pin numbers on the Raspberry Pi header, while GPIO.BCM uses Broadcom chip numbering.Step 2: Identify the correct constant for physical numberingGPIO.BOARD is the correct constant for physical pin numbering. Other options are invalid or incorrect.Final Answer:GPIO.setmode(GPIO.BOARD) -> Option CQuick Check:Physical pin numbering = GPIO.BOARD = B [OK]Quick Trick: Use GPIO.BOARD for physical pin numbers, GPIO.BCM for chip numbers [OK]Common Mistakes:Using GPIO.BCM when physical pins neededTyping invalid constants like GPIO.PHYSICALConfusing pin numbering modes
Master "GPIO Basics with Python" in Raspberry Pi9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Raspberry Pi Quizzes GPIO Basics with Python - Digital input (GPIO.input) - Quiz 15hard GPIO Basics with Python - Digital input (GPIO.input) - Quiz 14medium LED and Button Projects - Why LED and button projects build hardware confidence - Quiz 1easy PWM Output - RGB LED color mixing - Quiz 15hard PWM Output - LED brightness control - Quiz 4medium Raspberry Pi Platform - Operating system setup (Raspberry Pi OS) - Quiz 14medium gpiozero Library - PWMLED for brightness - Quiz 2easy gpiozero Library - Why gpiozero simplifies hardware - Quiz 15hard gpiozero Library - MotionSensor (PIR) - Quiz 4medium gpiozero Library - DistanceSensor (ultrasonic) - Quiz 14medium