wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Arduino

Total questions: 83

Worksheet time: 42mins

Name
Class
Date
1.

What is the base of Binary number?

a)

2

b)

8

c)

10

d)

16

2.

What is the base of Decimal number?

a)

2

b)

8

c)

10

d)

16

3.

Convert the Binary number (11010111000)2 to Hex?

a)

(D70)16

b)

(07D)16

c)

(6B8)16

d)

(8B6)16

4.

 Convert the octal number (313)8 to Binary number?

a)

(11010011)2

b)

(1100010011) 2

c)

(11001011) 2

d)

(1100100011) 2

5.

 Convert the decimal number (254) 10 to Binary number?

a)

(11111110)2

b)

(1111111) 2

c)

(111111110) 2

d)

(1001010100) 2

6.

How many bits are there in a Byte?

a)

4

b)

8

c)

1

d)

1000

7.

The number of Pulse Width Modulation (PWM) pins in an Arduino UNO board is?

a)

32

b)

8

c)

14

d)

6

8.

The correct instruction to make port D pins 1, 2, 4, 6 and 7 HIGH and other pins to LOW is?

a)

PORTD = B11010110;

b)

PORTD = B00101001;

c)

PORTD = B01101011;

d)

PORTD = B01100111;

9.

The instruction for setting the cursor to the 1st Row and 2nd Column is?

a)

lcd.print

b)

lcd.setCursor

c)

lcd.begin

d)

LiquidCrystal.h

10.

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

}

a)

i = i+++++;

b)

i = i+5;

c)

i = i5++;

d)

i = 5i++;

11.

void setup() {} void loop() {}

the function of this do-nothing program is to

a)

initialize variables

b)

catch and flag syntax errors

c)

clear out any old program

d)

repeat the instructions

12.

An Arduino is a type of

a)

PC

b)

Microcontroller

c)

CPU

d)

Sensor

13.

The two types of input/output pins on an Arduino are

a)

Real and Virtual

b)

Digital and Virtual

c)

Digital and Analog

d)

Open and Closed

14.

How many digital inputs do Arduino have?

a)

14

b)

13

c)

8

d)

20

15.

How many analog inputs does Arduino have?

a)

5

b)

6

c)

4

d)

3

16.

How many PWM outputs does Arduino have?

a)

5

b)

6

c)

4

d)

3

17.

What port 0 to 7 pins are representing?

a)

PORT A

b)

PORT B

c)

PORT C

d)

PORT D

18.

Digital Pins can read/write:

a)

Only ON or OFF (0 or 1)

b)

A continuous range (0-1023)

c)

3.3V or 5V

d)

Only 3.3 V

19.

Analog Pins can read range of

a)

Only ON or OFF (0 or 1)

b)

(0V -5V)

c)

Only  5V

d)

Only 3.3 V

20.

analogWrite(pin , val) set the PWM duty cycle as a

a)

Scale of 0 – 255

b)

Scale of 0 – 1023

c)

Scale of 0 – 5

d)

Scale Only 3.3 V

21.

The code to use for the start of a multi-line comment is

a)

/*

b)

/**

c)

//

d)

* /

22.

The code that indicates a single line of commentary will follow is

a)

/*

b)

/**

c)

//

d)

* /

23.

A sketch instruction that requests a LOW or HIGH reading from a specified input pin

a)

analogRead

b)

LOW

c)

HIGH

d)

digitalRead

24.

A sketch instruction that sends a LOW or HIGH voltage to a specified output pin

a)

digitalWrite

b)

Sensor

c)

analogWrite

d)

analogRead

25.

A sketch representation that specifies a 5V signal to an Arduino pin is

a)

LOW

b)

Pin

c)

HIGH

d)

digitalRead

26.

A sketch representation that specifies a 0V / GND signal to an Arduino pin is

a)

Sketch

b)

Pin

c)

HIGH

d)

LOW

27.

Why the 13th pin is different than other Arduino digital pins?

a)

Because it is an analog output to drive a motor

b)

Because it is connected to an onboard LED

c)

Because it is connected to all onboard LED

d)

Because it is a mysterious number

28.

What is the correct word that matches correctly with the comment:

void ______(){  //put your setup code here, to run once: }

a)

setup

b)

Loop

c)

digitalWrite

d)

INPUT

29.

What is the correct word that matches correctly with the comments:

void _____(){    // put your main code here, to run repeatedly: }

a)

setup

b)

Loop

c)

digitalWrite

d)

INPUT

30.

Which of these setups is the correct representation?

a)

void setup(){  }

b)

void setup();

c)

void setup{  }

d)

void setup{  };

31.

The meaning of   DDRD= B00000000; in the code list shown below is

a)

Define all PORTB pins as output

b)

Define all PORTB pins as input

c)

Define all PORTD pins as output

d)

Define all PORTD pins as input

32.

The meaning of   DDRD= B11111111; in the code list shown below is

a)

Define all PORTB pins as output

b)

Define all PORTB pins as input

c)

Define all PORTD pins as output

d)

Define all PORTD pins as input

33.

Choose the correct answer for the PORTD=B11110000; in the code list below

a)

PORTD will be 1 HIGH and 5 LOW.

b)

PORTD will be 5 HIGH and 1 LOW.

c)

PORTD will be 4 HIGH and 4 LOW.

d)

PORTD will be 4 outputs and 4 inputs.

34.

Choose the correct answer for the PORTD=0x15 in the code listed below

a)

PORTD will be 1 HIGH and 5 LOW.

b)

PORTD will be 5 HIGH and 1 LOW.

c)

PORTD will be 3 HIGH and 5 LOW.

d)

PORTD will be 4 outputs and 4 inputs.

35.

Choose the correct answer for the PORTD=15; in the code list below

a)

PORTD will be 1 HIGH and 5 LOW.

b)

PORTD will be 5 HIGH and 1 LOW.

c)

PORTD will be 4 HIGH and 4 LOW.

d)

PORTD will be 4 outputs and 4 inputs.

36.

What is the correct word that matches correctly with the comment:

pinMode(13,________);  //declare LED as outputs ?

a)

HIGH

b)

OUTPUT

c)

LOW

d)

INPUT

37.

What is the correct word that matches correctly with the comment:

pinMode(2,________);  //declare Switch as inputs ?

a)

HIGH

b)

OUTPUT

c)

LOW

d)

INPUT

38.

What is the correct instruction that matches correctly with the comment:

_________________ ;  // sets pin 3 as input pin ?

a)

pinMode(3, OUTPUT);

b)

pinMode(3, INPUT);

c)

digitalWrite(3, LOW);    

d)

digitalWrite(3, HIGH);    

39.

What is the correct instruction that matches correctly with the comment:

_________________ ;  // sets pin 3 as output pin ?

a)

pinMode(3, OUTPUT);

b)

pinMode(3, INPUT);

c)

digitalWrite(3, LOW);    

d)

digitalWrite(3, HIGH);    

40.

What is the correct word that matches correctly with the comment:

digitalWrite(13,_____);  //turn LED ON ?

a)

LOW

b)

OUTPUT

c)

HIGH

d)

INPUT

41.

What is the correct word that matches correctly with the comment:

digitalWrite(13,_____);  //turn LED OFF ?

a)

LOW

b)

OUTPUT

c)

HIGH

d)

INPUT

42.

What is the correct instruction that can satisfy with the comments:

 _______________(3,HIGH);  //turn LED ON ?

a)

pinMode

b)

digitalWrite

c)

analogRead

d)

INPUT

43.

What is the correct instruction that matches correctly with the comment:

____________________;  // Makes the output voltage ( 3, 5V) ?

a)

pinMode(3, OUTPUT);

b)

pinMode(3, INPUT);

c)

digitalWrite(3, LOW);    

d)

digitalWrite(3, HIGH);    

44.

What is the correct instruction that matches correctly with the comment:

__________________;  //Makes the output of pin 3 with duty cycle of 127 ?

a)

pinMode(3, 127)

b)

digitalWrite(3, 127)

c)

analogWrite(3, 127)

d)

digitalRead(3)

45.

What is the correct instruction that matches correctly with the comment:

int sw1 = _______________;  //reads the value of pin 2 in PORTD ?

a)

pinMode(2,OUTPUT)

b)

digitalWrite(2,INPUT)

c)

analogRead(2)

d)

digitalRead(2)

46.

What is the correct instruction that matches correctly with the comment:

int value =_________________;    //reads the value of A0 in PORTC ?

a)

pinMode(A0,OUTPUT)

b)

digitalWrite(A0,HIGH)

c)

analogRead(A0)

d)

digitalRead(A0)

47.

The if-statement is used to

a)

Switch between different cases.

b)

To repeat section of code for number of times.

c)

Check a condition and perform an operation

d)

Method to control the speed of DC motors.

48.

Which statement of the following has the meaning of "if Variable X is equal to 0

a)

If (X = 0 )

b)

If (X == 0 )

c)

If (variable X = 0 )

d)

If (X is equal to  0 )

49.

The for-loop is used to

a)

Switch between different cases.

b)

To repeat section of code for number of times.

c)

Check a condition and perform an operation

d)

Method to control the speed of DC motors.

50.

Which one of these for loops is properly written?

a)

for(int X=0; X<10;X++){}

b)

for(X=0, X<10,X++){}

c)

for(int X>0; X=10;X++){}

d)

for(int X==0; X<10;X++){}

51.

Which bit of code is required before you can use your serial monitor?

a)

serial.begin (127);

b)

Serial.begin(9600);

c)

Serial.print (255);

d)

void setup{  }; Serial.println

52.

What is the default speed of the serial connection from the computer to the Arduino?

a)

7500

b)

9600

c)

1200

d)

1024

53.

What is Pulse Width Modulation (PWM)?

a)

Switch between different cases.

b)

To repeat section of code for number of times.

c)

Check a condition and perform an operation.

d)

Method to control the speed of DC motors.

54.

What is the range of possible values in an ANALOG signal?

a)

0 or 1

b)

0 – 255

c)

0 -1023

d)

FORWARD or BACKWARD

55.

What is the range of possible values in an PWM?

a)

0 or 1

b)

0 – 255

c)

0 -1023

d)

FORWARD or BACKWARD

56.

To make a delay of (1.5 Sec) use:

a)

delay(1.5);

b)

delay(15);

c)

delay(150);

d)

delay(1500);

57.

What is the result of the following operation:

  int  X = 5;

  int  Y = 10;

  int  Z = 0;

   Z = Y + X;

   Z--;

a)

21

b)

20

c)

14

d)

15

58.

How many times the following loop will be repeated:

   int x = 2;

   while(x<=6)

  { PORTB = 255;

     delay(1000);

     PORTB = 0;

     delay(1000);

     x++;       }

a)

Infinitely

b)

4 times

c)

5 times

d)

6 times

59.

What will happen when you run the following codes:

int i=0;

while(i<10)

PORTD = 0xFF; 

delay(1000);

PORTD = 0x00; 

delay(1000);

i++;

}

a)

All pins in port D will go ON and OFF for 11 times.

b)

All pins in port D will go ON and OFF for 10 times.

c)

All pins in port D will go ON and OFF 9 times.

d)

All pins in port D will go ON and OFF for infinity.

60.

What will happen when you run the following codes:

int i=0;

while(i<10)

PORTD = 0xFF;

 delay(1000);

PORTD = 0x00;

 delay(1000);

}

a)

All pins in port D will go ON and OFF for 11 times.

b)

All pins in port D will go ON and OFF for 10 times.

c)

All pins in port D will go ON and OFF 9 times.

d)

All pins in port D will go ON and OFF for infinity.

61.

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);

    }

a)

6 times

b)

5 times

c)

4 times

d)

Infinitely

62.

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);}

a)

4

b)

5

c)

6

d)

7

63.

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;}

    }

a)

2

b)

8

c)

12

d)

14

64.

What is the result of the following operation:

   int X = B11110011;

   X = X<<3

a)

X = (11111100)2

b)

X = (00111100)2

c)

X = (10011000)2

d)

X= (00011110)2

65.

What is the result of the following operation:

 

  int X = B11110011;

   X = X>>2;

a)

X = (11111100)2

b)

X = (00111100)2

c)

X = (10011000)2

d)

X= (00011110)2

66.

What is the result of the following operation:

   int X = 23;

 

   X = X % 5;

a)

X=3

b)

X=4

c)

X = 4.6

d)

X=5

67.

Which is of the following a suitable application of an Arduino  PWM signal?

a)

Controlling the speed of a motor.

b)

Controlling the intensity of a LDR

c)

Controlling the speed of a LED.

d)

Sending radio frequency.

68.

Find the equivalent voltage of a PWM signal which has a duty cycle of 90%.

a)

0.45 V

b)

4.5V

c)

5 V

d)

5.4 V

69.

Find the value of duty in analogWrite(9, duty) of a PWM signal when duty cycle of 90% is required.

a)

109

b)

129

c)

229

d)

255

70.

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);

 }}

a)

The while loop will not start.

b)

All pins in port D will go ON and OFF for 11 times.

c)

All pins in port D will go ON and OFF 10 times.

d)

All pins in port D will go ON and OFF for infinity.

71.

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

                 }    }

a)

0

b)

8

c)

12

d)

16

72.

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);

}    }

a)

Pin 0, 2 and 4 in port B stay high while other pins stay low.

b)

Pin 4, 5, 6 and 7 in port B stay high while other pins stay low.

c)

Pin 0, 1, 2 and 3 in port B go high than low while other pins stay low.

d)

Pin 4, 5, 6 and 7 in port B go high than low while other pins stay low.

73.

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?

a)

PORTD = B00001010;

b)

PORTD = B00000101;

c)

PORTD = B00000110;

d)

PORTD = B00001100;

74.

To make a delay of (1.5 Sec) use:

a)

delay (1.5);

b)

delay (15);

c)

delay (150);

d)

delay (1500);

75.

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?

a)

5

b)

2

c)

6

d)

7

76.

 To set the cursor to the 1st Row and 2nd column, the required code is

a)

lcd.setCursor(1,2);

b)

lcd.setCursor(1,0);

c)

lcd.setCursor(0,1);

d)

lcd.setCursor(2,1);

77.

Digital input/output pins available in an Arduino Uno board are?

a)

6

b)

32

c)

3

d)

20

78.

The duty cycle of the Pulse Width Modulated signal shown below is

a)

25%

b)

 50%

c)

0%

d)

 100%

79.

State the name of the electronic device shown below ?

a)

Temperature Sensor

b)

Ultrasonic Sensor

c)

Light Sensor

d)

Magnetic Sensor

80.

State the function of the variable resistor, RV2 shown connected to the LCD module?

a)

To select reading mode or writing mode

b)

To provide power to display

c)

To adjust the display contrast.

d)

To turn ON and OFF the LED backlight.

81.

State the function of the module HC - SR04 shown below?

a)

Echo Pulse Generator

b)

Distance Sensor

c)

Audio Transmitter Receiver

d)

Stereo Generator

82.

Choose the correct statement for the electronic device shown below?

a)

Regulated power supply IC provides +5 Volts

b)

Input voltage required for the IC is from 7 to 8 Volts.

c)

IC provides output voltage from 0 to 5 Volts

d)

Regulated power supply IC provides -5 Volts

83.

If The Push button in the below circuit  is pushed then the value of (IO13) will be : 

a)

1 ( HIGH )

b)

0 ( LOW ) 

c)

255

d)

3.3 V