Bird
0
0

Which of the following is the correct way to start PWM on GPIO pin 18 with a frequency of 1000 Hz using RPi.GPIO?

easy📝 Syntax Q12 of 15
Raspberry Pi - PWM Output
Which of the following is the correct way to start PWM on GPIO pin 18 with a frequency of 1000 Hz using RPi.GPIO?
Apwm = GPIO.PWM(18, 1000); pwm.start(0)
Bpwm = GPIO.PWM(18); pwm.start(1000)
Cpwm = GPIO.PWM(1000, 18); pwm.start(0)
Dpwm = GPIO.PWM(18, 0); pwm.start(1000)
Step-by-Step Solution
Solution:
  1. Step 1: Check PWM constructor parameters

    RPi.GPIO PWM takes pin number first, then frequency in Hz.
  2. Step 2: Verify start method usage

    start() takes initial duty cycle (0-100), so start(0) is correct for off initially.
  3. Final Answer:

    pwm = GPIO.PWM(18, 1000); pwm.start(0) -> Option A
  4. Quick Check:

    GPIO.PWM(pin, freq) then start(duty) [OK]
Quick Trick: PWM(pin, frequency) then start(duty cycle) [OK]
Common Mistakes:
  • Swapping frequency and pin
  • Starting PWM with frequency instead of duty
  • Using zero frequency

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes