Digital I/O Quiz

Digital I/O Quiz

Test your knowledge of pinMode, digitalWrite, and button wiring. — 6 questions

Question 1 of 6 Score: 0

About the Digital I/O Quiz

Test your knowledge of pinMode, digitalWrite, and button wiring. This quiz has 6 multiple-choice questions. Each question has one correct answer, and you see an explanation straight after you answer, so you learn from every question — including the ones you get wrong. There is no time limit and nothing to sign up for; your answers are not stored.

The questions follow the material in the Digital I/O on Arduino guide and the Digital I/O Cheatsheet. Read them first if you want to prepare, or take the quiz cold to find the gaps in what you know.

Questions in this quiz

Preview the questions below. Each answer and its explanation are hidden until you choose to reveal them, so you can still take the quiz above without spoilers.

1. What value does digitalRead() return when a pin configured as INPUT_PULLUP is connected to GND?

  1. HIGH
  2. LOW
  3. 1023
  4. -1
Show answer

Answer: B. LOW
INPUT_PULLUP pulls the pin to HIGH internally. When you connect it to GND (e.g. press a button), it reads LOW.

2. Why do you need a resistor in series with an LED?

  1. To make it blink
  2. To limit current and prevent burning out the LED or pin
  3. To increase brightness
  4. LEDs do not need resistors
Show answer

Answer: B. To limit current and prevent burning out the LED or pin
Without a current-limiting resistor, too much current flows through the LED, burning it out or damaging the Arduino pin.

3. What does pinMode(9, OUTPUT) do?

  1. Reads the current value of pin 9
  2. Sets pin 9 to HIGH
  3. Configures pin 9 to drive voltage (output mode)
  4. Enables the internal pull-up on pin 9
Show answer

Answer: C. Configures pin 9 to drive voltage (output mode)
pinMode() configures the direction of a pin. OUTPUT means the pin can source/sink current to drive components.

4. What is debouncing a button?

  1. Removing the button from the circuit
  2. Filtering out rapid noise signals when a button is pressed
  3. Adding a second button for redundancy
  4. Setting a very high baud rate
Show answer

Answer: B. Filtering out rapid noise signals when a button is pressed
Mechanical buttons produce brief electrical noise when pressed. Debouncing ignores readings for a short time after the first state change.

5. Which mode should you use to read a button without adding an external resistor?

  1. OUTPUT
  2. INPUT
  3. INPUT_PULLUP
  4. ANALOG
Show answer

Answer: C. INPUT_PULLUP
INPUT_PULLUP activates the Arduino built-in pull-up resistor, so the pin defaults to HIGH and reads LOW when the button connects it to GND.

6. What is the maximum current you should draw from a single Arduino Uno digital pin?

  1. 10 mA
  2. 40 mA
  3. 200 mA
  4. 500 mA
Show answer

Answer: B. 40 mA
Each Arduino Uno pin can safely source or sink up to 40 mA. The total for all pins combined is 200 mA.

How to use this quiz

  • Answer every question before reading the explanations below — retrieving an answer from memory is what makes it stick.
  • Note the questions you missed and revisit the matching section of the guide or cheatsheet.
  • Retake the quiz a day or two later. Spaced repetition is one of the most reliable ways to remember technical details.

Related