Bird
0
0

You want to read two buttons on GPIO pins 5 and 6. Button on pin 5 should read HIGH when pressed, and button on pin 6 should read LOW when pressed. How should you configure internal resistors?

hard📝 Application Q9 of 15
Raspberry Pi - GPIO Basics with Python
You want to read two buttons on GPIO pins 5 and 6. Button on pin 5 should read HIGH when pressed, and button on pin 6 should read LOW when pressed. How should you configure internal resistors?
APin 5 with pull-down resistor, pin 6 with pull-up resistor
BPin 5 with pull-up resistor, pin 6 with pull-down resistor
CBoth pins with pull-up resistor
DBoth pins with pull-down resistor
Step-by-Step Solution
Solution:
  1. Step 1: Determine resistor for pin 5

    To read HIGH when pressed, use pull-down resistor so pin is LOW by default and goes HIGH when button connects to 3.3V.
  2. Step 2: Determine resistor for pin 6

    To read LOW when pressed, use pull-up resistor so pin is HIGH by default and goes LOW when button connects to ground.
  3. Final Answer:

    Pin 5 with pull-down resistor, pin 6 with pull-up resistor -> Option A
  4. Quick Check:

    Pull-down for HIGH press, pull-up for LOW press [OK]
Quick Trick: Pull-down for HIGH press, pull-up for LOW press buttons [OK]
Common Mistakes:
  • Mixing resistor types for desired button logic
  • Using same resistor for both pins
  • Ignoring button wiring polarity

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes