Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

LetsStartCoding Review

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

In the example digitalWrite(13,HIGH);, what are the arguments?

a)

digital and Write

b)

HIGH

c)

13 and HIGH

d)

13

2.

If you make the value of both delays smaller, what will happen?

a)

the LED will blink slower

b)

the LED will blink faster

c)

Nothing changes

d)

The LED will stay on

3.

How many times will the LED blink if you let the example code run?

a)

10 times

b)

100 times

c)

15 times

d)

forever

4.

Sets up your hardware pin to receive power

a)

pinMode

b)

digitalWrite

c)

digitalRead

5.

tone(A5,250) ; Send a tone of ________ hertz to pin A5

a)

250

b)

300

c)

200

d)

150

6.

What symbols (called syntax) begin and end the void setup function?

a)

( and )

b)

{ and }

c)

;

d)

//comments

7.

What syntax begins and ends the void loop function?

a)

( and )

b)

{ and }

c)

//comments

d)

;

8.

If you type:

tone(A5,500);

noTone(A5);

how long will you hear the tone of 500 hertz?

a)

1 second

b)

10 seconds

c)

You won't hear it at all

d)

You'll hear it continuously

9.

What is the maximum number of ELSE IF statements you can string together?

a)

Only one else if statement per if statement

b)

Up to ten else if statements per if statement

c)

Unlimited else if statements per if statement-string together as many as you want

10.

When does an else if statement get run?

a)

Every time the loop runs

b)

Only when the if statement it is paired with is true

c)

Only when the if statement it is paired with is false

11.

Which of these words is the best definition of variable?

a)

A word that holds a value

b)

A number in the code

c)

A code command for electronics

12.

What goes between the parentheses of an if statement?

a)

The condition that is being checked by the if statement

b)

The code that will run when the if statement is true

13.

Because the variable is outside of any function

(above void setup() and void loop() ),

you can refer to it as a ______ variable.

a)

global

b)

local

c)

static

14.

How many arguments does the digitalRead() function require?

a)

1

b)

2

c)

3

d)

4

15.

How many code commands can be run inside an if statement?

a)

Ten commands maximum

b)

One command maximum

c)

Two commands maximum

d)

Unlimited number of commands

16.

When does an else statement run?

a)

every time the loop passes over it

b)

Never

c)

when all the if and else if statements in the same chain are false

17.

When you type the code:

tone(A5, 250);

digitalWrite(2, HIGH);

which command runs first?

a)

The tone() command runs first because it is above the digitalWrite() command

b)

The digitalWrite() command runs first because it has a lower pin number

c)

They run at exactly the same time

18.

What is the range of the

analogWrite() function?

a)

0 to 100

b)

0 or 1

c)

0 to 255

d)

0 to 1000

19.

What are the arguments needed by the constrain function?

a)

Pin number and HIGH or LOW.

b)

Variable, minimum value, maximum value.

c)

Minimum value, maximum value.

d)

Pin number and mode.

20.

In the example, what is the lowest value that the pitch variable can have?

a)

0

b)

5

c)

40

d)

41

21.

What is a different way to code

variable = variable + 1; ?

a)

variable ++1;

b)

variable +1;

c)

variable ++;