Bird
0
0

Consider this Arduino code snippet:

medium📝 Predict Output Q5 of 15
Raspberry Pi - Platform
Consider this Arduino code snippet:
void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); }

What does this code do?
ASends data over serial port continuously
BReads input from pin 13 every second
CTurns an LED on pin 13 on and off every second
DCauses a syntax error due to missing semicolons
Step-by-Step Solution
Solution:
  1. Step 1: Analyze pinMode and digitalWrite usage

    pinMode(13, OUTPUT) sets pin 13 as output; digitalWrite sets pin HIGH or LOW.
  2. Step 2: Understand delay and loop behavior

    Loop turns pin 13 HIGH (on), waits 1 second, then LOW (off), waits 1 second, repeating.
  3. Final Answer:

    Turns an LED on pin 13 on and off every second -> Option C
  4. Quick Check:

    Pin 13 blinking LED = Turns LED on/off [OK]
Quick Trick: digitalWrite HIGH/LOW controls pin voltage (LED on/off) [OK]
Common Mistakes:
  • Confusing output with input reading
  • Assuming serial communication
  • Missing semicolons is incorrect here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes