Arduino Course Final Exam
Arduino Course Final Exam
Min
Choose the best answer for each question :1. Which of these can an Arduino NOT be used for?
a. controlling servos
b. displaying analog inputs
c. building robots
d. an Arduino can be used to do all of these
2. What are the Arduinos two main program structures?
a. setup and loop
b. main and setup
c. loop and main
d. int and setup
3. How many analog ports does an Arduino have?
a. five, and they are labeled A1-A5
b. six, and they are labeled A0-A5
c. six, and they are labeled A1-A6
d. five, and they are labeled A0-A4
4. Which of these is a digital input device?
a. pressure sensor
b. servo
c. button
d. potentiometer
5. Which of these is an analog input device?
a. pressure sensor
b. servo
c. button
d. LED
6. Which of these is an output device?
a. pressure sensor
b. servo
c. button
d. potentiometer
7. What command would you use to tell the Arduino that there is an output on port
9?
a. int sensorPin = 9;
b. int sensorValue = 9;
c. digitalWrite(9, HIGH);
d. pinMode(9, OUTPUT);
8. What command would you use to light up an LED on port 5?
a. int sensorPin = A0;
b. int sensorValue = 0;
c. digitalWrite(5, HIGH);
d. pinMode(5, OUTPUT);
9. How would you pause a program for 2.5 seconds?
a. delay(2500)
b. int sensorValue = 0;
c. delay(2.5);
d. pinMode(ledPin, OUTPUT);
10. How do you read values from the Arduino on the computer screen?
a. the View button
b. the Serial Monitor button
c. the Upload button
d. you cannot read values from the Arduino on the screen
11. What is the command for playing a musical note on the Arduino?
a. tone();
b. play();
c. note();
d. sound();
The questions in the next section are answered by referring to the following
program:
int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
sensorValue = analogRead(sensorPin);
digitalWrite(ledPin, HIGH);
delay(sensorValue);
digitalWrite(ledPin, LOW);
delay(sensorValue);
}
12. What is the purpose of line 4?
a. To begin the setup program structure
b. To begin the loop program structure
c. To set the input value of port 13 to ON
d. line 4 has no function in the program
13. What is the purpose of line 9?
a. Analog .
b. Digital .
c. Input .
d. Output .
22. Pins configured as OUTPUT are said to be in a low-impedance state and can
provide .. of current to other devices/circuits.
a. 20 mA .
b. 30 mA .
c. 40 mA .
d. 50 mA .
23. analogRead(pin) Reads the value from a specified analog pin with a .
resolution.
a. 8-bit .
b. 10-bit .
c. 12-bit .
d. 16-bit .
24. analogWrite(pin, value) Writes a pseudo-analog value using hardware enabled
pulse width modulation (PWM) to an output pin marked PWM. The value can be
specified as a variable or constant with a value from
a. 0 - 5 .
b. 0 - 13 .
c. 0 - 1023 .
d. 0 - 255 .
25. The typical baud rate for communicating with the computer is .. although
other speeds are supported.
a. 4800 .
b. 9600 .
c. 38400 .
d. 115200 .
26. When using serial communication, digital pins ...... cannot be used at the same
time.
a. 0 & 1 .
b. 0 & 13 .
c. 2 & 3 .
d. 1 & 13 .
27. The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically. The board can operate
on an external supply of volts.
a. 0 to 5 .
b. 0 to 9 .
c. 5 to 9 .
d. 6 to 20 .
28. PWM: 3, 5, 6, 9, 10, and 11. Provide . PWM output with
the analogWrite() function.
a. 8-bit .
b. 10-bit .
c. 12-bit .
d. 16-bit .
Write short notes about the following :1- Arduino advantages over other microcontrollers .
2- Compare between Arduino Uno and Arduino Mega 2560 .
3- DC motor , Servo motor , Stepper motor .
4- ADCs parameters .
5- Describe briefly how can you make your own Arduino .
23.
24.
delay(500);
}