Bird
0
0

Which of the following is the correct syntax to start PWM on GPIO pin 12 with a frequency of 500 Hz using RPi.GPIO?

easy📝 Syntax Q3 of 15
Raspberry Pi - PWM Output
Which of the following is the correct syntax to start PWM on GPIO pin 12 with a frequency of 500 Hz using RPi.GPIO?
Apwm = GPIO.PWM(12, 500)
Bpwm = GPIO.PWM(500, 12)
Cpwm = GPIO.startPWM(12, 500)
Dpwm = GPIO.PWMStart(12, 500)
Step-by-Step Solution
Solution:
  1. Step 1: Recall PWM initialization syntax

    RPi.GPIO PWM is started with GPIO.PWM(pin_number, frequency).
  2. Step 2: Check option correctness

    Only pwm = GPIO.PWM(12, 500) matches the correct syntax; others have wrong method names or argument order.
  3. Final Answer:

    pwm = GPIO.PWM(12, 500) -> Option A
  4. Quick Check:

    PWM syntax = GPIO.PWM(pin, freq) [OK]
Quick Trick: PWM starts with GPIO.PWM(pin, frequency) [OK]
Common Mistakes:
  • Swapping pin and frequency arguments
  • Using incorrect method names like startPWM

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes