Q2

Lesson 2 Quiz: Digital Output, Variables, and Serial Output

Test your understanding of pins, serial output, variables, conditionals, and basic C syntax

32-Week Course � Semester 1

Quiz Instructions

  • � This quiz covers material from Lesson 2: Digital Output, Variables, and Serial Output
  • � Answer all questions to the best of your ability
  • � Your responses will be emailed to your instructor for review
  • � Take your time and think carefully about each answer
  • � You can review the lesson material if needed before submitting

Student Information

Question 1: Pin Modes

What does pinMode(13, OUTPUT); tell the Arduino to do?

Question 2: Digital Output

Which line of code turns a digital output on?

Question 3: Serial Output

What is the main difference between Serial.print() and Serial.println()?

Question 4: Variables

Which variable type is best for storing a whole number like 10?

Question 5: Conditionals

What does if (count == 0) mean?

Question 6: Syntax

Which statement about semicolons and comments is correct?

Question 7: Code Analysis

Explain the difference between x = 0; and x == 0.

Question 8: Personal Program

Describe your blink-and-count program. How did you use digital output, variables, or Serial messages in your code?