Font size
WorksheetsArduino
Total questions: 83
Worksheet time: 42mins
What is the base of Binary number?
2
8
10
16
What is the base of Decimal number?
2
8
10
16
Convert the Binary number (11010111000)2 to Hex?
(D70)16
(07D)16
(6B8)16
(8B6)16
Convert the octal number (313)8 to Binary number?
(11010011)2
(1100010011) 2
(11001011) 2
(1100100011) 2
Convert the decimal number (254) 10 to Binary number?
(11111110)2
(1111111) 2
(111111110) 2
(1001010100) 2
How many bits are there in a Byte?
4
8
1
1000
The number of Pulse Width Modulation (PWM) pins in an Arduino UNO board is?
32
8
14
6
The correct instruction to make port D pins 1, 2, 4, 6 and 7 HIGH and other pins to LOW is?
PORTD = B11010110;
PORTD = B00101001;
PORTD = B01101011;
PORTD = B01100111;
The instruction for setting the cursor to the 1st Row and 2nd Column is?
lcd.print
lcd.setCursor
lcd.begin
LiquidCrystal.h
Choose the correct code modification required to increment the value of “ i” by 5 and print.
void loop() {
lcd.setCursor(2, 1); // set location of cursor
lcd.print(i); / print the value of variable i
.........; // increment i by 5 (modify?)
delay(1000); // wait for 1 second
}
i = i+++++;
i = i+5;
i = i5++;
i = 5i++;
void setup() {} void loop() {}
the function of this do-nothing program is to
initialize variables
catch and flag syntax errors
clear out any old program
repeat the instructions
An Arduino is a type of
PC
Microcontroller
CPU
Sensor
The two types of input/output pins on an Arduino are
Real and Virtual
Digital and Virtual
Digital and Analog
Open and Closed
How many digital inputs do Arduino have?
14
13
8
20
How many analog inputs does Arduino have?
5
6
4
3
How many PWM outputs does Arduino have?
5
6
4
3
What port 0 to 7 pins are representing?
PORT A
PORT B
PORT C
PORT D
Digital Pins can read/write:
Only ON or OFF (0 or 1)
A continuous range (0-1023)
3.3V or 5V
Only 3.3 V
Analog Pins can read range of
Only ON or OFF (0 or 1)
(0V -5V)
Only 5V
Only 3.3 V
analogWrite(pin , val) set the PWM duty cycle as a
Scale of 0 – 255
Scale of 0 – 1023
Scale of 0 – 5
Scale Only 3.3 V
The code to use for the start of a multi-line comment is
/*
/**
//
* /
The code that indicates a single line of commentary will follow is
/*
/**
//
* /
A sketch instruction that requests a LOW or HIGH reading from a specified input pin
analogRead
LOW
HIGH
digitalRead
A sketch instruction that sends a LOW or HIGH voltage to a specified output pin
digitalWrite
Sensor
analogWrite
analogRead
A sketch representation that specifies a 5V signal to an Arduino pin is
LOW
Pin
HIGH
digitalRead
A sketch representation that specifies a 0V / GND signal to an Arduino pin is
Sketch
Pin
HIGH
LOW
Why the 13th pin is different than other Arduino digital pins?
Because it is an analog output to drive a motor
Because it is connected to an onboard LED
Because it is connected to all onboard LED
Because it is a mysterious number
What is the correct word that matches correctly with the comment:
void ______(){ //put your setup code here, to run once: }
setup
Loop
digitalWrite
INPUT
What is the correct word that matches correctly with the comments:
void _____(){ // put your main code here, to run repeatedly: }
setup
Loop
digitalWrite
INPUT
Which of these setups is the correct representation?
void setup(){ }
void setup();
void setup{ }
void setup{ };
The meaning of DDRD= B00000000; in the code list shown below is
Define all PORTB pins as output
Define all PORTB pins as input
Define all PORTD pins as output
Define all PORTD pins as input
The meaning of DDRD= B11111111; in the code list shown below is
Define all PORTB pins as output
Define all PORTB pins as input
Define all PORTD pins as output
Define all PORTD pins as input
Choose the correct answer for the PORTD=B11110000; in the code list below
PORTD will be 1 HIGH and 5 LOW.
PORTD will be 5 HIGH and 1 LOW.
PORTD will be 4 HIGH and 4 LOW.
PORTD will be 4 outputs and 4 inputs.
Choose the correct answer for the PORTD=0x15 in the code listed below
PORTD will be 1 HIGH and 5 LOW.
PORTD will be 5 HIGH and 1 LOW.
PORTD will be 3 HIGH and 5 LOW.
PORTD will be 4 outputs and 4 inputs.
Choose the correct answer for the PORTD=15; in the code list below
PORTD will be 1 HIGH and 5 LOW.
PORTD will be 5 HIGH and 1 LOW.
PORTD will be 4 HIGH and 4 LOW.
PORTD will be 4 outputs and 4 inputs.
What is the correct word that matches correctly with the comment:
pinMode(13,________); //declare LED as outputs ?
HIGH
OUTPUT
LOW
INPUT
What is the correct word that matches correctly with the comment:
pinMode(2,________); //declare Switch as inputs ?
HIGH
OUTPUT
LOW
INPUT
What is the correct instruction that matches correctly with the comment:
_________________ ; // sets pin 3 as input pin ?
pinMode(3, OUTPUT);
pinMode(3, INPUT);
digitalWrite(3, LOW);
digitalWrite(3, HIGH);
What is the correct instruction that matches correctly with the comment:
_________________ ; // sets pin 3 as output pin ?
pinMode(3, OUTPUT);
pinMode(3, INPUT);
digitalWrite(3, LOW);
digitalWrite(3, HIGH);
What is the correct word that matches correctly with the comment:
digitalWrite(13,_____); //turn LED ON ?
LOW
OUTPUT
HIGH
INPUT
What is the correct word that matches correctly with the comment:
digitalWrite(13,_____); //turn LED OFF ?
LOW
OUTPUT
HIGH
INPUT
What is the correct instruction that can satisfy with the comments:
_______________(3,HIGH); //turn LED ON ?
pinMode
digitalWrite
analogRead
INPUT
What is the correct instruction that matches correctly with the comment:
____________________; // Makes the output voltage ( 3, 5V) ?
pinMode(3, OUTPUT);
pinMode(3, INPUT);
digitalWrite(3, LOW);
digitalWrite(3, HIGH);
What is the correct instruction that matches correctly with the comment:
__________________; //Makes the output of pin 3 with duty cycle of 127 ?
pinMode(3, 127)
digitalWrite(3, 127)
analogWrite(3, 127)
digitalRead(3)
What is the correct instruction that matches correctly with the comment:
int sw1 = _______________; //reads the value of pin 2 in PORTD ?
pinMode(2,OUTPUT)
digitalWrite(2,INPUT)
analogRead(2)
digitalRead(2)
What is the correct instruction that matches correctly with the comment:
int value =_________________; //reads the value of A0 in PORTC ?
pinMode(A0,OUTPUT)
digitalWrite(A0,HIGH)
analogRead(A0)
digitalRead(A0)
The if-statement is used to
Switch between different cases.
To repeat section of code for number of times.
Check a condition and perform an operation
Method to control the speed of DC motors.
Which statement of the following has the meaning of "if Variable X is equal to 0
If (X = 0 )
If (X == 0 )
If (variable X = 0 )
If (X is equal to 0 )
The for-loop is used to
Switch between different cases.
To repeat section of code for number of times.
Check a condition and perform an operation
Method to control the speed of DC motors.
Which one of these for loops is properly written?
for(int X=0; X<10;X++){}
for(X=0, X<10,X++){}
for(int X>0; X=10;X++){}
for(int X==0; X<10;X++){}
Which bit of code is required before you can use your serial monitor?
serial.begin (127);
Serial.begin(9600);
Serial.print (255);
void setup{ }; Serial.println
What is the default speed of the serial connection from the computer to the Arduino?
7500
9600
1200
1024
What is Pulse Width Modulation (PWM)?
Switch between different cases.
To repeat section of code for number of times.
Check a condition and perform an operation.
Method to control the speed of DC motors.
What is the range of possible values in an ANALOG signal?
0 or 1
0 – 255
0 -1023
FORWARD or BACKWARD
What is the range of possible values in an PWM?
0 or 1
0 – 255
0 -1023
FORWARD or BACKWARD
To make a delay of (1.5 Sec) use:
delay(1.5);
delay(15);
delay(150);
delay(1500);
What is the result of the following operation:
int X = 5;
int Y = 10;
int Z = 0;
Z = Y + X;
Z--;
21
20
14
15
How many times the following loop will be repeated:
int x = 2;
while(x<=6)
{ PORTB = 255;
delay(1000);
PORTB = 0;
delay(1000);
x++; }
Infinitely
4 times
5 times
6 times
What will happen when you run the following codes:
int i=0;
while(i<10)
{
PORTD = 0xFF;
delay(1000);
PORTD = 0x00;
delay(1000);
i++;
}
All pins in port D will go ON and OFF for 11 times.
All pins in port D will go ON and OFF for 10 times.
All pins in port D will go ON and OFF 9 times.
All pins in port D will go ON and OFF for infinity.
What will happen when you run the following codes:
int i=0;
while(i<10)
{
PORTD = 0xFF;
delay(1000);
PORTD = 0x00;
delay(1000);
}
All pins in port D will go ON and OFF for 11 times.
All pins in port D will go ON and OFF for 10 times.
All pins in port D will go ON and OFF 9 times.
All pins in port D will go ON and OFF for infinity.
Referring to the codes listed below, how many times the loop will be repeated?
for(int i = 0 ; i <=5 ; i++)
{
PORTD = 0xFF;
delay(1000);
PORTD = 0x00;
delay(1000);
}
6 times
5 times
4 times
Infinitely
How many times the following loop will be repeated when all pins in port D are configured as output?
Char x = 0;
void loop()
{
While(x<=6)
{
PORTD= 255;
delay (1000);
PORTD = 0;
delay (1000);
X++; }
exit (0);}
4
5
6
7
What is the final value of the variable num after running the following codes?
int num = 0;
for(int i = 0 ; i <=10 ; i++)
{
if(i<4) {num = num + 2;}
}
2
8
12
14
What is the result of the following operation:
int X = B11110011;
X = X<<3
X = (11111100)2
X = (00111100)2
X = (10011000)2
X= (00011110)2
What is the result of the following operation:
int X = B11110011;
X = X>>2;
X = (11111100)2
X = (00111100)2
X = (10011000)2
X= (00011110)2
What is the result of the following operation:
int X = 23;
X = X % 5;
X=3
X=4
X = 4.6
X=5
Which is of the following a suitable application of an Arduino PWM signal?
Controlling the speed of a motor.
Controlling the intensity of a LDR
Controlling the speed of a LED.
Sending radio frequency.
Find the equivalent voltage of a PWM signal which has a duty cycle of 90%.
0.45 V
4.5V
5 V
5.4 V
Find the value of duty in analogWrite(9, duty) of a PWM signal when duty cycle of 90% is required.
109
129
229
255
What will happen when you run the following codes:
void setup()
{
DDRD = 0xFF;
}
void loop()
{
int i=0;
while(i<10){
PORTD = 0xFF; delay(1000);
PORTD = 0x00; delay(1000);
}}
The while loop will not start.
All pins in port D will go ON and OFF for 11 times.
All pins in port D will go ON and OFF 10 times.
All pins in port D will go ON and OFF for infinity.
What is the final value of the variable num after running the following codes?
void loop()
{
int num = 0;
for(i = 0 ; i <=10 ; i++)
{
if(i<4)
num = num * 2;
else
} }
0
8
12
16
What will happen when SW1 is pressed and released?
int SW1 = 13;
void setup (){
pinMode(SW1, INPUT);
}
void loop(){
while(digitalRead(SW1) == HIGH){
PORTB = 0x15;
delay (1000);
} }
Pin 0, 2 and 4 in port B stay high while other pins stay low.
Pin 4, 5, 6 and 7 in port B stay high while other pins stay low.
Pin 0, 1, 2 and 3 in port B go high than low while other pins stay low.
Pin 4, 5, 6 and 7 in port B go high than low while other pins stay low.
Figure (1) shows L293D motor driver that is connected to port D in microcontroller. What is the appropriate output that should be sent to port D in order to the two motors move opposite each other?
PORTD = B00001010;
PORTD = B00000101;
PORTD = B00000110;
PORTD = B00001100;
To make a delay of (1.5 Sec) use:
delay (1.5);
delay (15);
delay (150);
delay (1500);
for (i=0; i<6; i++)
{
instructions
}
Refer the “for loop” command shown above and state the number of times the instructions will be repeated?
5
2
6
7
To set the cursor to the 1st Row and 2nd column, the required code is
lcd.setCursor(1,2);
lcd.setCursor(1,0);
lcd.setCursor(0,1);
lcd.setCursor(2,1);
Digital input/output pins available in an Arduino Uno board are?
6
32
3
20
The duty cycle of the Pulse Width Modulated signal shown below is
25%
50%
0%
100%
State the name of the electronic device shown below ?
Temperature Sensor
Ultrasonic Sensor
Light Sensor
Magnetic Sensor
State the function of the variable resistor, RV2 shown connected to the LCD module?
To select reading mode or writing mode
To provide power to display
To adjust the display contrast.
To turn ON and OFF the LED backlight.
State the function of the module HC - SR04 shown below?
Echo Pulse Generator
Distance Sensor
Audio Transmitter Receiver
Stereo Generator
Choose the correct statement for the electronic device shown below?
Regulated power supply IC provides +5 Volts
Input voltage required for the IC is from 7 to 8 Volts.
IC provides output voltage from 0 to 5 Volts
Regulated power supply IC provides -5 Volts
If The Push button in the below circuit is pushed then the value of (IO13) will be :
1 ( HIGH )
0 ( LOW )
255
3.3 V
