Bird
0
0

You want to smoothly dim an LED connected to pin 17 from off to full brightness using Software PWM. Which approach correctly achieves this?

hard📝 Application Q15 of 15
Raspberry Pi - PWM Output
You want to smoothly dim an LED connected to pin 17 from off to full brightness using Software PWM. Which approach correctly achieves this?
ASet duty cycle to 100 immediately and then to 0 after 5 seconds
BUse a loop increasing duty cycle from 0 to 100 with small delays between steps
CChange frequency from 0 to 1000 Hz gradually while keeping duty cycle constant
DCall GPIO.cleanup() repeatedly in a loop while PWM is running
Step-by-Step Solution
Solution:
  1. Step 1: Understand smooth dimming with PWM

    Smooth dimming requires gradually changing the duty cycle from 0% (off) to 100% (full brightness).
  2. Step 2: Identify correct method

    Using a loop to increase duty cycle with small delays creates a smooth brightness change.
  3. Final Answer:

    Use a loop increasing duty cycle from 0 to 100 with small delays between steps -> Option B
  4. Quick Check:

    Gradual duty cycle change = smooth dimming [OK]
Quick Trick: Increase duty cycle stepwise with delay for smooth dimming [OK]
Common Mistakes:
  • Changing frequency instead of duty cycle
  • Setting duty cycle instantly without steps
  • Calling cleanup during PWM operation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes