WorksheetsLetsStartCoding Review
Total questions: 21
Worksheet time: 11mins
In the example digitalWrite(13,HIGH);, what are the arguments?
digital and Write
HIGH
13 and HIGH
13
If you make the value of both delays smaller, what will happen?
the LED will blink slower
the LED will blink faster
Nothing changes
The LED will stay on
How many times will the LED blink if you let the example code run?
10 times
100 times
15 times
forever
Sets up your hardware pin to receive power
pinMode
digitalWrite
digitalRead
tone(A5,250) ; Send a tone of ________ hertz to pin A5
250
300
200
150
What symbols (called syntax) begin and end the void setup function?
( and )
{ and }
;
//comments
What syntax begins and ends the void loop function?
( and )
{ and }
//comments
;
If you type:
tone(A5,500);
noTone(A5);
how long will you hear the tone of 500 hertz?
1 second
10 seconds
You won't hear it at all
You'll hear it continuously
What is the maximum number of ELSE IF statements you can string together?
Only one else if statement per if statement
Up to ten else if statements per if statement
Unlimited else if statements per if statement-string together as many as you want
When does an else if statement get run?
Every time the loop runs
Only when the if statement it is paired with is true
Only when the if statement it is paired with is false
Which of these words is the best definition of variable?
A word that holds a value
A number in the code
A code command for electronics
What goes between the parentheses of an if statement?
The condition that is being checked by the if statement
The code that will run when the if statement is true
Because the variable is outside of any function
(above void setup() and void loop() ),
you can refer to it as a ______ variable.
global
local
static
How many arguments does the digitalRead() function require?
1
2
3
4
How many code commands can be run inside an if statement?
Ten commands maximum
One command maximum
Two commands maximum
Unlimited number of commands
When does an else statement run?
every time the loop passes over it
Never
when all the if and else if statements in the same chain are false
When you type the code:
tone(A5, 250);
digitalWrite(2, HIGH);
which command runs first?
The tone() command runs first because it is above the digitalWrite() command
The digitalWrite() command runs first because it has a lower pin number
They run at exactly the same time
What is the range of the
analogWrite() function?
0 to 100
0 or 1
0 to 255
0 to 1000
What are the arguments needed by the constrain function?
Pin number and HIGH or LOW.
Variable, minimum value, maximum value.
Minimum value, maximum value.
Pin number and mode.
In the example, what is the lowest value that the pitch variable can have?
0
5
40
41
What is a different way to code
variable = variable + 1; ?
variable ++1;
variable +1;
variable ++;
