Bird
0
0

Which of the following is the correct syntax to set GPIO pin 17 as an output pin?

easy📝 Syntax Q12 of 15
Raspberry Pi - GPIO Basics with Python
Which of the following is the correct syntax to set GPIO pin 17 as an output pin?
AGPIO.setmode(17, GPIO.OUT)
BGPIO.setup(17, GPIO.IN)
CGPIO.output(17, GPIO.OUT)
DGPIO.setup(17, GPIO.OUT)
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct function to set pin mode

    GPIO.setup(pin, mode) is used to set pin mode.
  2. Step 2: Choose the correct mode for output

    GPIO.OUT sets the pin as output.
  3. Final Answer:

    GPIO.setup(17, GPIO.OUT) -> Option D
  4. Quick Check:

    Use setup with OUT for output pins [OK]
Quick Trick: Use GPIO.setup(pin, GPIO.OUT) for output pins [OK]
Common Mistakes:
  • Using GPIO.output instead of GPIO.setup to set mode
  • Confusing GPIO.setmode with GPIO.setup
  • Setting pin as input instead of output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes