ArduinoBasicsQuiz-1
ArduinoBasicsQuiz-1
_____
Arduino Quiz
Directions: Look at the Pictures below and match them with the correct
word.
1. __________LED 5. __________Arduino Uno
2. __________Switch 6. __________Servo
3. __________Resister 7. __________ Breadboard
4. __________9 volt battery 8. __________ Header Pins
A B
C D
E F
G H
Name: _____________________ Pd. _____
Directions: Look at the code below and describe what each line of the
program does to tell the computer what to do (write comments).
int switchState = 0;
void setup(){
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2, INPUT);
}
void loop() {
switchState=digitalRead(2);
if (switchState == LOW) {
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
}
else {
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(2000);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
delay(5000);
}
}
Directions: Write the code needed to make one LED blink on for a
second and then off for a second.
void setup(){
}
void loop() {