Bird
0
0

Which edge detection option should you use with GPIO.add_event_detect to detect when a button is pressed (assuming active low button)?

easy📝 Conceptual Q2 of 15
Raspberry Pi - LED and Button Projects
Which edge detection option should you use with GPIO.add_event_detect to detect when a button is pressed (assuming active low button)?
AGPIO.FALLING
BGPIO.RISING
CGPIO.BOTH
DGPIO.NONE
Step-by-Step Solution
Solution:
  1. Step 1: Understand button wiring (active low)

    An active low button connects the pin to ground when pressed, causing the signal to go from HIGH to LOW.
  2. Step 2: Choose correct edge detection

    Since the signal falls from HIGH to LOW on press, use GPIO.FALLING to detect the press event.
  3. Final Answer:

    GPIO.FALLING -> Option A
  4. Quick Check:

    Active low button press = FALLING edge [OK]
Quick Trick: Active low button press triggers FALLING edge [OK]
Common Mistakes:
  • Using RISING edge for active low button
  • Choosing BOTH unnecessarily
  • Using NONE which is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes