Bird
0
0

How would you modify a traffic light simulation to add a pedestrian crossing button that pauses the green light when pressed?

hard📝 Application Q8 of 15
Raspberry Pi - LED and Button Projects
How would you modify a traffic light simulation to add a pedestrian crossing button that pauses the green light when pressed?
AAdd a second green LED to blink continuously
BUse a GPIO input pin to detect button press and pause green LED output
CIncrease the sleep time for green LED without input detection
DRemove the yellow light phase
Step-by-Step Solution
Solution:
  1. Step 1: Understand pedestrian button function

    The button should be detected as input to control the green light timing.
  2. Step 2: Implement input detection and pause

    Using a GPIO input pin to detect button press allows pausing the green LED output safely.
  3. Final Answer:

    Use a GPIO input pin to detect button press and pause green LED output -> Option B
  4. Quick Check:

    Button detection requires GPIO input pin [OK]
Quick Trick: Use GPIO input pins for buttons [OK]
Common Mistakes:
  • Ignoring input detection
  • Changing LED behavior without input
  • Removing necessary light phases

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes