Bird
0
0

In a PWM control script, the LED brightness does not change when adjusting the duty cycle variable. Which of these is the most likely cause?

medium📝 Debug Q7 of 15
Raspberry Pi - PWM Output
In a PWM control script, the LED brightness does not change when adjusting the duty cycle variable. Which of these is the most likely cause?
AThe PWM object was not started with pwm.start()
BThe Raspberry Pi GPIO pins do not support PWM
CThe duty cycle variable is set above 100
DThe frequency is set to 0 Hz
Step-by-Step Solution
Solution:
  1. Step 1: Check PWM initialization

    If pwm.start() is not called, PWM signal does not begin, so duty cycle changes have no effect.
  2. Step 2: Evaluate other options

    GPIO pins do support PWM via software; duty cycle above 100 is invalid but usually causes error; frequency 0 Hz is invalid but would cause error.
  3. Final Answer:

    The PWM object was not started with pwm.start() -> Option A
  4. Quick Check:

    pwm.start() needed to activate PWM [OK]
Quick Trick: Always call pwm.start() to begin PWM signal [OK]
Common Mistakes:
  • Assuming hardware PWM is required
  • Setting invalid duty cycle without error
  • Ignoring pwm.start() call

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes