NEW
Font size
WorksheetsEngineering First Semester
Total questions: 15
Worksheet time: 29mins
Which of the following will cause a pause of 3 seconds?
delay(3);
delay(300);
delay(3000);
digitalWrite(delay,3);
Which of the following is special about what goes inside the {} following void setup () ?
It runs only once
It repeats 3 times
It repeats over and over again
It can only contain statements about pinMode
In which of these programs do you NEED to use analogWrite?
Turning on an LED
Turning on an RGB LED
Turning an RGB LED pink
All of the above
What will x equal at the end of the following code:
int x=4;
if (x!=4) {
x=3;
}
3
4
int
it could be anything
What will x equal at the end of the following code:
int x=7;
if (x==7) {
x=3;
x++;}
else{
x=2;}
2
3
4
5
7
How many legs does an RGB LED have?
1
2
3
4
When hooking up a button, where should you put the resistor?
In between the button and ground
In between the button's two legs
You need 2 resistors, one between the button and ground, the other between the button and 5 V
You don't need a resistor, it always works fine without one
If I hook up an RGB LED's green leg to pin 5, and its ground leg to ground...what will the following line of code accomplish?
analogWrite(5,120);
It will turn the LED blue
It will turn the LED light green
It will print 120 on the Serial Monitor
It will print 5 on the Serial Monitor
What is the difference between hooking up an LED to ground and 5V, or hooking it up to ground and pin 6?
(In both cases assume you have a resistor in the correct place)
In the latter case, the LED can't possibly turn on
In the latter case, the LED will always be on
In the former case, the LED will always be on
In the former case, the LED can't possibly turn on
What will happen if you have the following as the loop section of your code:
void loop()
{
digitalWrite(13, HIGH); //turns on green LED
digitalWrite(13, LOW); //turns off green LED
digitalWrite(12, HIGH); //turns on yellow LED
digitalWrite(12, LOW); //turns off yellow LED
digitalWrite(11, HIGH); //turns on red LED
delay(1000);
digitalWrite(11, LOW); //turns off red LED
}
You'll see a red LED
You'll see a green LED
You'll see a cyan LED
You'll see an off LED
When do you need to include Serial.begin(9600);
in the setup of your code?
Whenever you plan to use an LED
Whenever you plan to use a button
Whenever you plan to print onto your Serial Monitor
Whenever you plan to use analogWrite
int place=1;
Serial.print("A");
Serial.print(place);
What will get printed?
A1
A
1
Aplace
A
place
Which of the following is NOT a difference between digitalWrite and analogWrite?
digitalWrite can only output HIGH or LOW, analogWrite can output 256 possible levels
digitalWrite can attach to any pin 0 to 13, analogWrite can only be done on the pins with ~
digitalWrite can only be used to turn off an RGB LED, analogWrite can be used to turn them on as well
On a RGB LED, digitalWrite can create only certain colors, analogWrite can create a much wider range of colors
Which of the following is an example of something that does INPUT and not OUTPUT?
Button
LED
RGB LED
Speaker
Why is it so important to include a resistor in your circuits that turn on LEDs?
Otherwise its impossible for the LED to turn on
Otherwise the LED will burn out since too much electricity will flow through it
Otherwise it may be tempted to join the government over the resistance
Otherwise the breadboard won't provide electricity
