Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

5 . Input Control LED

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which function is used to initialize serial communication in an Arduino sketch?

a)

Serial.begin()

b)

Serial.start();

c)

Serial.Begin();

d)

Serial.begin();

2.

What baud rate is commonly used for serial communication with the Arduino Serial Monitor?

a)
2400
b)
115200
c)
9600
d)
4800
3.

Which function is used to print data to the Serial Monitor?

a)
Serial.write()
b)
Serial.read()
c)
Serial.begin()
d)
Serial.print()
4.
  • Which function reads incoming serial data from the Serial Monitor?

a)
Serial.receive()
b)

Serial.read()

c)
Serial.fetch()
d)

Serial.transmit()

5.

What type of data does the "Serial.read() "function return?

a)

character

b)
boolean
c)
float
d)
string
6.

Which function is used to check if data is available to read from the Serial Monitor?

a)
Serial.read()
b)
Serial.check()
c)
Serial.ready()
d)
Serial.available()
7.

How can you print a new line after printing data to the Serial Monitor?

a)
Serial.print(' ');
b)
Serial.write(' ');
c)
Serial.writeLine();
d)
Serial.println();
8.

Which of the following is a correct way to initialize serial communication at 9600 baud in the setup function?

a)
Serial.begin(9600, SERIAL_8N1)
b)
Serial.begin(9600)
c)
Serial.begin(9600, SERIAL_7E1)
d)
Serial.begin(9600, SERIAL_5E2)
9.

How can you send the string "Hello, World!" to the Serial Monitor?

a)
Serial.println("Hello, World!");
b)
Serial.write('Hello, World!');
c)
Serial.print('Hello, World!');
d)
Serial.begin('Hello, World!');
10.

Choose the correct option

a)

if(Serial.available() > 0)

{

char state = Serial.read()

if(state == '1'){

digitalWrite(led,HIGH);}

if(state == '0'){

digitalWrite(led,LOW);}

}

b)

if(Serial.available() > 0)

{

char state = Serial.read()

if(state == 'a'){

digitalWrite(led,HIGH);}

if(state == 'b'){

digitalWrite(led,LOW);}

}

c)

if(Serial.available() > 0)

{

char state = Serial.read()

if(state == 1){

digitalWrite(led,HIGH);}

if(state == 0){

digitalWrite(led,LOW);}

}

d)

if(Serial.available() > 0)

{

char state = Serial.read()

if(state == a){

digitalWrite(led,HIGH);}

if(state == b){

digitalWrite(led,LOW);}

}