Q6

Lesson 6 Quiz: Functions with Arduino

Test your understanding of defining, calling, and using simple functions in Arduino code

32-Lesson Course • Semester 1

Quiz Instructions

  • This quiz covers material from Lesson 6: Functions with Arduino
  • 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: What is a function?

What is a function in Arduino programming?

Question 2: Built-In Functions

Which two functions are already part of every basic Arduino sketch?

Question 3: Calling a Function

Which line correctly calls a function named printWelcome?

Question 4: Understanding void

What does void usually mean at the beginning of a beginner function definition?

Question 5: Parameters

What is a parameter in a function like void printResult(int answer)?

Question 6: Reading a Function Call

If the code says showTemperatureConversion(25.0);, what value is being sent into the function?

Question 7: Why Use Functions?

Which is the best reason to use functions in a beginner Arduino program?

Question 8: Code Analysis

What does this function do?
void printResult(int answer) { Serial.println(answer); }

Question 9: Code Analysis

Explain what happens when showAddition(7, 5); calls a function that adds the two numbers and prints the answer.

Question 10: Function-Based Arduino Program

Describe a simple Arduino program that uses functions. What functions did you make, what values or hardware did they use, and what did the program do?