Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FINAL INTERIM

Total questions: 35

Worksheet time: 53mins

Name
Class
Date
1.

Scenario: You are setting up your first Arduino project to turn on a light when a button is pressed. You have connected the Button to Pin 7 and the LED to Pin 8. Before the loop() runs, you need to tell the Arduino how to treat these pins. Which command should you use inside void setup()?

a)

pinMode(7, OUTPUT); pinMode(8, INPUT);

b)

digitalWrite(7, INPUT); digitalWrite(8, OUTPUT);

c)

pinMode(7, INPUT); pinMode(8, OUTPUT);

d)

define(7, INPUT); define(8, OUTPUT);

2.

Scenario: You have written a code that successfully turns on an LED. Now, you want the Arduino to check if the user is currently pressing the button. Which function allows the Arduino to "see" the state of Pin 7?

a)

digitalWrite(BUTTON_PIN)

b)

digitalRead(BUTTON_PIN)

c)

analogRead(BUTTON_PIN)

d)

pinMode(BUTTON_PIN)

3.

Scenario: You are troubleshooting a classmate's circuit. They are using a standard push button setup. You notice two resistors on the breadboard. One is connected to the LED, and the other is connected to the button leg and Ground. What is the likely value of the resistor connected to the button circuit?

a)

220 ohms

b)

50 ohms

c)

10k ohms

d)

1k ohms

4.

A developer is reviewing your code and notices you used #define LED_PIN 8 at the very top of your sketch. They ask why you didn't just type the number 8 inside the digitalWrite commands. What is the correct justification?

a)

It converts the digital signal into an analog signal.

b)

It makes the code run faster by skipping the setup loop.

c)

It creates a constant, allowing you to change the pin number in one place if you move the wire later.

d)

It effectively debounces the button signal automatically.

5.

Scenario: You are coding a switch. You want the LED to turn ON when the button is pressed and immediately turn OFF when released. Which logic block accurately reflects this behavior?

a)

if (button == HIGH) { LED = LOW; } else { LED = HIGH; }

b)

if (button == HIGH) { LED = HIGH;

c)

toggle(LED_PIN);

d)

if (button == HIGH) { LED = HIGH; } else { LED = LOW; }

6.

Scenario: You observe the code line delay(1000); immediately after the motor finishes its backward rotation of -2048 steps. What is the specific mechanical purpose of this delay in the context of the loop cycle?

a)

To allow the motor coils to cool down.

b)

To let the motor come to a complete stop before the loop restarts and instantly tries to spin it forward again.

c)

To allow the Arduino to recalculate the value of Pi.

d)

To recharge the 5V rail.

7.

You are looking at the code and you see the line unsigned long lastTimeButtonStateChanged = millis();. What is the specific purpose of using millis() here instead of delay()?

a)

millis() pauses the program to wait for the button.

b)

millis() resets the Arduino clock to zero.

c)

millis() forces the button to read in milliseconds rather than digital logic.

d)

millis() captures the current running time to track how long it has been since the last event without stopping the code.

8.

Scenario: You have successfully implemented this code block if (ledState == HIGH) { ledState = LOW; } else { ledState = HIGH; } executes. What is the immediate result of this block?

a)

The LED physically turns on or off immediately.

b)

The Arduino resets.

c)

The button stops reading input for 50ms.

d)

The variable ledState updates in memory, but the LED physically changes only when digitalWrite is called next.

9.

Scenario: You want to count how many times a user clicks a button. You write the following code inside void loop() without implementing the "State Change" logic shown :

void loop() { if (digitalRead(BUTTON_PIN) == HIGH) { pressCount = pressCount + 1; Serial.println(pressCount); } }

You upload the code and press the button exactly once, holding it down for a normal duration (about half a second). What happens on your screen?

a)

The number 1 prints exactly once.

b)

The number 1 prints repeatedly for as long as you hold the button.

c)

A stream of hundreds of increasing numbers prints (e.g., 1, 2, ... 450, 451...).

d)

The code crashes because pressCount overflows immediately.

10.

Scenario: You are excited to test your code. You write the command digitalWrite(8, HIGH); inside your loop to turn on the LED. However, you completely forget to include the line pinMode(8, OUTPUT); inside your setup() function.

When you run the code, what does the LED connected to Pin 8 actually do?

a)

It lights up, but it is very dim compared to normal.

b)

It does not light up at all (it stays completely dark).

c)

It flashes rapidly because the pin is floating.

d)

It works perfectly fine; pinMode is optional for LEDs.

11.

Scenario: You are building a simple alarm system using an Arduino and a buzzer component that looks like the black cylinder .To turn the buzzer ON within your code, which logic level signal must you send to its control pin?

a)

INPUT

b)

LOW

c)

GND

d)

HIGH

12.

Scenario: A student connects a buzzer to Pin 8 and a button to Pin 7. Before they can use the buzzer to make sound, they must configure Pin 8 in the void setup() function. Which command is correct?

a)

pinMode(8, INPUT);

b)

digitalRead(8, OUTPUT);

c)

pinMode(8, OUTPUT);

d)

analogWrite(8, 255);

13.

Scenario: You are writing a program where the buzzer sounds ONLY while a button is being held down. You use the code if (digitalRead(BUTTON_PIN) == HIGH). What specific hardware component state does the condition == HIGH correspond to in this setup?

a)

The button is currently released.

b)

The button is currently pressed.

c)

The buzzer is disconnected.

d)

The Arduino is powered off.

14.

Scenario: You are reviewing the wiring diagram for the Button and Buzzer project. You notice a resistor placed between the button leg and the ground rail. What should be the value of this resistor?

a)

220 ohms

b)

1k ohms

c)

10k ohms

d)

50 ohms

15.

Scenario: Your code includes the line #define BUZZER_PIN 8 at the very top. Later in the code, you decide to move the buzzer wire from Pin 8 to Pin 10. What is the main advantage of having used #define in this scenario?

a)

You only need to change the number 8 to 10 in one place (the top of the code).

b)

The Arduino will automatically detect the new pin location without code changes.

c)

It converts the digital signal to analog automatically.

d)

It increases the voltage output to the buzzer.

16.

Scenario: A developer wants to use the buzzer to provide "User Feedback" in their application. Based on the "Applications of Arduino Buzzers" , which of the following is a specific example of this use case?

a)

Detecting the end of a timer.

b)

Playing sound effects for a game.

c)

Notifying when a specific temperature is reached.

d)

Providing auditory feedback for button presses or mode changes.

17.

Scenario: You are analyzing the void loop() function. If the button is NOT pressed, the else block executes. What command is found inside this else block to silence the buzzer?

a)

digitalWrite(BUZZER_PIN, HIGH);

b)

digitalRead(BUZZER_PIN, LOW);

c)

digitalWrite(BUZZER_PIN, LOW);

d)

noTone(BUZZER_PIN);

18.

Scenario: You are using the specific type of buzzer shown in the slide image, which is described as having a "built-in oscillating circuit." Because of this internal feature, how does the buzzer behave when it receives power?

a)

It requires complex code with varying frequencies to make any sound.

b)

It produces sound immediately as soon as it is powered.

c)

It stays silent until a specific PWM signal is received.

d)

It requires an external oscillator component to function.

19.

Scenario: You have written the following logic inside your loop:

if (digitalRead(7) == HIGH) { digitalWrite(8, HIGH); }

However, you forgot to write the else statement that sets Pin 8 to LOW. What will likely happen when you run this code and press the button once?

a)

The buzzer will beep once and stop automatically.

b)

The buzzer will not turn on at all.

c)

The Arduino will reset itself.

d)

The buzzer will turn ON and stay ON indefinitely, even after you release the button.

20.

Scenario: You want the stepper motor to rotate exactly 90 degrees clockwise to open a valve. Given the motor specification found in the code (2048 steps per revolution), what value must you pass to the step() function?

a)

myStepper.step(90);

b)

myStepper.step(1024);

c)

myStepper.step(2048);

d)

myStepper.step(512);

21.

Scenario: You are designing a robot arm that performs other tasks (like reading a sensor) while the motor is moving. You add a sensor read command inside the loop() immediately after myStepper.step(2048);. You notice the sensor is only read after the motor finishes spinning. Why?

a)

The Arduino is too slow to process both.

b)

The step() function is "blocking," meaning the processor halts all other code execution until the motor finishes its assigned steps.

c)

The power draw from the motor shuts down the sensors.

d)

The delay(1000) prevents the sensor from reading.

22.

Scenario: You are writing a sketch to control a servo. You type Servo myServo; and myServo.attach(9);, but the compiler throws an error saying 'Servo' does not name a type. What critical line of code is missing at the very top of your file?

a)

#include <Servo.h>

b)

define Servo 9

c)

void setupServo()

d)

int servoPin = 9;

23.

Scenario: A student is writing a program that needs to remember if a button was pressed in the previous loop cycle. They declare the variable byte lastButtonState; inside the void loop() function. Why will this logic fail?

a)

It will cause a compilation error because byte cannot be used inside functions.

b)

The variable will automatically lock the button in the HIGH state.

c)

The logic will fail because the variable is re-created and reset every time the loop restarts, causing the Arduino to "forget" the previous state.

d)

It won't fail; this is the standard way to track state changes.

24.

Scenario: You are experimenting with the void loop() code. You decide to remove the line delay(15); that appears after myServo.write(pos); inside the for loop. What will be the immediate physical result on the servo motor?

a)

The servo will move incredibly slowly because it waits for a default timer.

b)

The servo will not move at all because the signal is too short.

c)

The Arduino will disconnect from the computer.

d)

The servo will try to move instantly to the target, likely causing it to jitter or move too fast to perceive a smooth sweep.

25.

Scenario: You want to control the servo manually without using the <Servo.h> library. You attach the signal wire to a pin and use a potentiometer to vary the voltage on that pin from 0V to 5V (Analog Write). The servo does not move to the correct angles. Why does this fail based on the "Key Features" ?

a)

Servos require 12V to operate, not 5V.

b)

Servos are controlled by the Pulse Width (PWM) of the signal, not the voltage level.

c)

The servo needs a digital signal of 0V only.

d)

The feedback mechanism prevents manual voltage control.

26.

Scenario: You are reviewing a classmate's code. They have declared Servo myBot; at the top, but inside void setup(), they forgot to write myBot.attach(9);. Inside their loop, they have myBot.write(90);. What happens when the code runs?

a)

The servo moves to 90 degrees because Pin 9 is the default.

b)

The servo moves to 0 degrees as a safety measure.

c)

The servo does not move because the Arduino doesn't know which pin sends the signal.

d)

The code will refuse to compile.

27.

Scenario: You apply an external force to push the servo arm away from its set position of 90 degrees. You feel the motor fighting back to return to 90 degrees. Which component is responsible for this self-correction?

a)

The PWM Signal Generator

b)

The Power Supply

c)

The USB Cable

d)

The Internal Feedback Mechanism

28.

Scenario: You are looking at the second for loop in the example code: for (int pos = 180; pos >= 0; pos -= 1). If you accidentally changed pos -= 1 to pos += 1, what would be the logical outcome of this loop?

a)

The servo would sweep normally from 180 to 0.

b)

The loop would likely run forever (infinite loop) or crash, as pos would keep growing larger than 180.

c)

The servo would stop at 90 degrees.

d)

The servo would reverse direction immediately.

29.

Scenario: A student claims their servo is broken because it only has three wires, but they think motors need a "+" and "-" wire only. You explain that the third wire is for the "Control Signal". According to the "Wiring" slide, which specific pin on the Arduino Uno is used for this signal in the example?

a)

5V

b)

GND

c)

A0

d)

Pin 9

30.

Scenario: You construct a physical circuit where pressing the button sends a HIGH signal (5V) to the Arduino. However, you copy a code snippet that uses the logic if (digitalRead(BUTTON_PIN) == LOW) to trigger an action. What behavior will you observe when you run this?

a)

The action will trigger when you release the button (when it goes back to LOW), rather than when you press it.

b)

The LED will blink continuously regardless of the button.

c)

The Arduino will short circuit because the logic is inverted.

d)

The button will stop working entirely.

31.

Scenario: You are troubleshooting a project using the exact code provided in the slides. The motor moves forward perfectly, pauses, but then just vibrates or hums without moving backward. You suspect a power issue, but your lab partner points to the code line myStepper.step(-2048);. What is the technical significance of the negative sign in this function?

a)

It reduces the speed of the motor by half for the return journey.

b)

It acts as a brake command to stop the motor's momentum.

c)

It commands the library to reverse the sequence of high/low signals sent to the driver pins, effectively reversing the rotation.

d)

It tells the motor to skip 2048 steps

32.

Scenario: You are designing a precision clock using this stepper motor. The 2048 steps are needed for one full revolution. If you change the code to myStepper.step(1024);, what is the exact physical position of the motor shaft relative to its starting point?

a)

It has rotated 180 degrees.

b)

It has rotated 90 degrees.

c)

It has rotated 360 degrees but at half speed.

d)

It has rotated 45 degrees.

33.

Scenario: You have set int motorSpeed = 10; and called myStepper.setSpeed(motorSpeed);. A classmate challenges you to make the motor spin faster by changing only the step command in the loop to myStepper.step(100);. Does this make the motor spin faster?

a)

Yes, because taking fewer steps allows it to finish the cycle quicker.

b)

No, step() only controls distance. Speed is strictly determined by the setSpeed function defined in setup.

c)

Yes, decreasing the step count increases the voltage.

d)

No, the motor will actually stop moving because 100 is too low.

34.

Scenario: You are creating a project that uses a buzzer to alert a user when a timer finishes. You choose the specific buzzer type shown in the documentation, which has a "built-in oscillating circuit." What is the main benefit of using this specific type of buzzer for your code?

a)

You must write complex frequency arrays to make it sound.

b)

It can produce sound as soon as you send a simple HIGH signal (power) to it.

c)

It requires an external crystal oscillator to function.

d)

It can play MP3 files directly.

35.

Scenario: You are using #define BUZZER_PIN 8 at the start of your code. Later, inside void setup(), you accidentally type pinMode(8, OUTPUT); instead of using the defined name. What is the result?

a)

The code will fail to compile because you mixed methods.

b)

The code will work fine because BUZZER_PIN and 8 represent the same value.

c)

The buzzer will work, but at half volume.

d)

The Arduino will crash immediately.