Arduino Questions and Answers – Standard Libraries

This set of Arduino Multiple Choice Questions & Answers (MCQs) focuses on “Standard Libraries”.

1. What is the name for the library to manipulate data in and out of the EEPROM of the Arduino Board?
a) EEPROM.h
b) eeprom.h
c) Eeprom.h
d) eepROM.h
View Answer

Answer: a
Explanation: The EEPROM is a type of memory in microcontrollers that is able to retain the data that was fed to it even after the power supply is cut off from the chip.The EEPROM.h library allows us to perform read, write, clear, updating, etc. operations on the EEPROM of our Arduino Board. This is a standard library that can be used for all Arduino Boards.

2. What is the objective of the code given below if it is executed on the Arduino Uno?

  1. #include<EEPROM.h>
  2. int pin=13;
  3. void setup() {
  4.     pinMode(pin,OUTPUT);
  5.     Serial.begin(9600);
  6. }
  7. void loop() {
  8.     for(int i=0;i<EEPROM.length();i++) {
  9.         EEPROM.write(i, 1);
  10.     }
  11.     digitalWrite(pin,HIGH);
  12.     exit(0);
  13. }

a) Fill EEPROM with 1’s
b) Fill EEPROM with 0’s
c) Clear EEPROM
d) Export EEPROM data
View Answer

Answer: a
Explanation: The EEPROM.write() function is used to write data to the EEPROM directly. This function takes in 2 argurments; the address to which the data is to be written, and the data which is to be written to the EEPROM in the specified address. The program fills the EEPROM with 1’s and then turns on the onboard LED of the Arduino Uno.
advertisement
advertisement

3. Which of the following statements is not true when dealing with the Firmata library?
a) The Firmata Library is used to establish communications between the Arduino and the Desktop
b) The Firmata Library uses the Firmata Protocol for communicating data
c) The Firmata Library uses the Midi Message Format
d) The Firmata Library can only be used on an Arduino Uno
View Answer

Answer: d
Explanation: The Firmata Library is used for communicating data to and from the computer. This is required when the Arduino is required to store certain data on the computer which would be otherwise too large for the Arduino to store in its internal memory. Other uses of this library are in the field of IOT.
Note: Join free Sanfoundry classes at Telegram or Youtube

4. Which of these devices are supported by the Wire Library?
a) I2C Bus
b) Wi-Fi Devices
c) Bluetooth Devices
d) Cellular Devices
View Answer

Answer: a
Explanation: The Wire Library is used to communicate data with the I2C (Inter IC) or TWI (Two Wire Interface) Bus which are almost identical to each other and are used for communicating data to different microcontrollers.

5. What is the use of the Ethernet library?
a) To connect the Arduino to Bluetooth
b) To connect the Arduino to Wi-Fi
c) To connect the Arduino to Li-Fi
d) To connect the Arduino to Ethernet
View Answer

Answer: d
Explanation: The Ethernet Library is used to connect the Arduino to the internet via an Ethernet connection. This library is designed to be used with any Arduino Ethernet Shields or any other W5100, W5200, etc. based devices.
advertisement

6. If one would want to place a call using an Arduino which library would one use which was specifically designed for that purpose?
a) The Firmata Library
b) The TFT Library
c) The GSM Library
d) The Ethernet Library
View Answer

Answer: c
Explanation: The GSM library on the Arduino helps the user to perform call, SMS, or even Internet Communications via the GSM Module. This library works in conjunction with the GSM Shield which uses a modem and AT commands to connect the Arduino to the GSM network.

7. What is the use of the SD.h Library in Arduino?
a) To communicate with the SD Card Module
b) To communicate with another microcontroller
c) To communicate with the computer
d) To communicate with the internet
View Answer

Answer: a
Explanation: The SD.h Library in Arduino allows for communications between the Arduino Board and an SD Card Module for storage and retrieval of data. It is dependent on the sdfatlib library which works on FAT16 and FAT32 filesystems.
advertisement

8. Which interface does SD.h depend on for communication between the SD Card Module and the Arduino?
a) SPI
b) I2C
c) USB
d) TTL
View Answer

Answer: a
Explanation: The SD.h library for communication between SD Card Modules and Arduinos use SPI (Serial Peripheral Interface) for establishing communications. The SPI is a synchronous Serial Communication Protocol which is used for short distance communications between microcontrollers and devices like SD Card Readers, shift resistors, etc.

9. What is the library to be used if one wants to use UART communications on an Arduino?
a) TFT Library
b) SoftwareSerial Library
c) Ethernet Library
d) I2C Library
View Answer

Answer: b
Explanation: The UART (Universal Asynchronous Receiver Transmitter) is a piece of hardware that allows digital communications between 2 IC’s. The pins on the Arduino that support this are 0 and 1. This functionality is parallel in nature, i.e. the Atmega chip on the Arduino can receive UART data and continue to work on whatever it was working on, at the same time.

10. Which chipset is the LCD library for Arduino based on?
a) Hitachi HD44780
b) Hitachi HD45780
c) Hitachi HDD4780
d) Hitachi HD46780
View Answer

Answer: a
Explanation: The LCD Library in Arduino allows for controlling LCD Displays with the Arduino. This is based on the Hitachi HD44780 Chipset which is a dot matrix LCD (Liquid Crystal Display) Driver. It can be configured and used with 4-bit and 8-bit microcontrollers.

Sanfoundry Global Education & Learning Series – Arduino.

To practice all areas of Arduino, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.