NEW
Font size
WorksheetsSpring Final Review Part II
Total questions: 35
Worksheet time: 20mins
What is a loop?
A type of storage for us to store information we use in a code
Allows us to run the code many times
The type of information we store in a code
What is the variable of the following statement:
int count = 3;
int
count
3
;
What does this function does?
digitalWrite ()
writes output value to either HIGH or LOW
writes output value using PWM sequence
sets a pin to either INPUT or OUTPUT
pauses the program
What does this function does?
pinMode ()
writes output value to either HIGH or LOW
writes output value using PWM sequence
sets a pin to either INPUT or OUTPUT
pauses the program
What happens when you run this code:
digitalWrite (red, HIGH);
delay (5000);
The red LED lights up for 5000 seconds
The red LED turns off for 5000 seconds
The red LED turns on for 5 seconds
When connecting a LED to the Arduino the cathode must be connected to:
Positive
5V
Negative
Any terminal available
In order to produce light the anode must be connected to:
the negative pole of the battery
the positive pole of the battery
It does not matter
What do you call the long wire on the LED?
Cathode
Anode
Resistor
RGB
The code "int yellow = 5;"...
should be placed in the setup ().
creates a variable that can store a letter or number.
creates an integer variable with the value of 5
is not valid C++ code
A forward slash (i.e. // put your setup code here, to run once:) is used for
code
output
comments
The following line of code, means ________
pinMode(12, OUTPUT);
Make the device in pin 13 set to ON state.
Set the device in pin 12 as input.
Set the device in pin 12 as output.
Make the device in pin 12 set to Off state.
The result of the following line Code is______
print(7%3);
0
1
2
3
What is the output of the snippet code ?
3
4
5
6
How to define a Led connected to pin 13 in Arduino?
Pinmode(13,INPUT);
pinMode(13,INPUT);
Pinmode(13,OUTPUT);
pinMode(13,OUTPUT);
Which function runs only one time?
loop();
setup();
calculate();
random();
What is the output for the following code?
int x=5;
int y=3;
x+=y;
Serial.print(x+y);
6
8
10
11
Increment variable
&&
||
++
- -
Decrement variable
&&
||
++
- -
A variable that can only be seen, used and updated by code within the same scope. Typically this means the variable was declared (created) inside a function -- includes function parameter variables.
global variable
local variable
true variable
false variable
A variable that can be used and updated by any part of the code. Its scope is typically derived from the variable being declared (created) outside of any function, object, or method.
global variable
local variable
true variable
false variable
This holds one of two values, true or false.
boolean
float
char
void
Comparison operator which means equal to.
++
==
--
!=
Comparison operator which means not equal to.
++
==
--
!=
Comparison operator which means greater than or equal to.
//
&&
<=
>=
Used to end a statement
!
"
;
\
Which command is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. It will only run once, after each power up or reset of the Arduino board.
loop ( )
delay( )
setup ( )
input( )
Which command is called repetitively over and over again as long as the Arduino has power.
loop ( )
delay( )
setup ( )
input( )
