Search Header Logo
Arduino Exam Revision 3

Arduino Exam Revision 3

Assessment

Presentation

English

7th - 12th Grade

Practice Problem

Easy

Created by

Bayden Schellein

Used 1+ times

FREE Resource

8 Slides • 15 Questions

1

Arduino Exam Revision 3

By Bayden Schellein

2

Conditional Statements - IF

media

3

The picture shows a list math operations the loop can check for.

Operations?

media

4

Conditional Statements - IF

In this example the code checks to see if the variable X is equal to 5, if it is then it prints the phrase 'X is 5!!'.

If it does not equal 5 then nothing happens.

if (Condition) {code to run}

media

5

Drag and Drop

write an IF statement to check if a sensor is less than 400 using the boxes below.​

(​
) {}
Drag these tiles and drop them in the correct blank above
IF
SensorValue
<400)
>400
ELSE
is less

6

Multiple Choice

Question image

What will the code do if the temp is 35?

1

Print "It's hot!" only

2

Print both "It's hot!" and "Stay hydrated!"

3

Cause an error

4

Print "Stay hydrated!" only

7

Conditional Statements - ELSE

media

8

Labelling

Label the code

Drag labels to their correct position on the image

Code if TRUE

Code If FALSE

Keyword

Condition

9

Multiple Choice

Question image

What will the following Arduino code print if x = 7?

1

Greater than 5

2

5 or less

3

Nothing, because x is not defined

4

error

10

Multiple Choice

What happens if the condition inside an if statement is false?

1

The code inside the if block runs anyway

2

The program crashes

3

The else block (if present) runs instead

4

The program stops

11

We can also check for multiple conditions at once.
If we use AND (&&) then we can check if two or more conditions are true.

AND? OR?

media
media

12

Match

Question image

Match the numbers with the colour it would produce

110

650

325

950

500

Red

Cyan

Yellow

Magenta

Green

13

Multiple Choice

How do you check if x is between 10 and 20 in Arduino?

1
2
3
4

14

We can also check for multiple conditions at once.
If we use OR (||) then we can check if one or another condition are true.

AND? OR?

media
media

15

Multiple Choice

Question image

What will the following Arduino code print if x = 3?

1

Match Found

2

No Match

3

Error: OR condition used incorrectly

4

It won’t print anything

16

Multiple Choice

Which of these is a correct way to check if a variable temp is below 0°C OR above 100°C?

1
2
3
4

17

Multiple Choice

Question image

What will the following Arduino code print if buttonState = HIGH and motionDetected = LOW?

1

Action Triggered

2

No Action

3

Error: OR condition used incorrectly

4

It won’t print anything

18

Dropdown

Question image
Modify the following Arduino code to turn on an LED if either button is pressed (button1 == HIGH OR button2 == HIGH).



{ digitalWrite(ledPin, HIGH); }

19

Conditional Statements - ELSE IF

media
media

20

Match

Question image

Match what the code will run if the sensorValue is:

300

450

550

700

Low

Normal

Normal

High

21

Match

Question image

Match the output for the program when the temperature is:

45

66

22

1

150

Warm

Very Hot

Mild

Cold

Extreme Danger!

22

Multiple Choice

Question image

We want to modify the program and insert a new else if command after 'mild' but before 'cold'.

The new code should checks that the temperature is greater than or equal to 5.

If true it should respond with 'Freezing'

Select the correct code

1
2
3
4

23

Open Ended

Question image

This program has an issue.

  1. Identify the issue and explain what the problem is and why the program wont work.

  2. Fix the code

Arduino Exam Revision 3

By Bayden Schellein

Show answer

Auto Play

Slide 1 / 23

SLIDE

Discover more resources for English