Arduino language: Quizz

Quizz on the Arduino language

In this course we will see a little quizz which will allow you to test your knowledge on Arduino language.

The purpose of the quizz is to know which part of our course you need to read. The anwsers are at the end of the quizz.

There is only one correct anwser for each question

1.What are the mandatory function on the Arduino language ?

A) Void main

B) Void Setup and Void Loop

C) Only Void loop

2.What is the function void setup is useful for?

A) The function is used to initialize pins, the serial monitor.

B)  The function is used to initialize variable and libraries.

C) This function contains all the program.

3. How to call a library?

A) #include

B) //include

C) #include “Library.h”

4. What is the function digitalWrite is useful for?

A) To read a pin

B) To assign a value to the digital Pin

C) To assign a value to the analogue Pin

5. The range of the numerical value read by the analogRead() can be :

A) From -1 to 5

B) From 0 to 254

C) From -1 to 1

6. How to write a comment on the Arduino language?

A) #My comment

B) // My comment

C) % My comment

7. How to initialize a variable integer ?

A) int variable_integer =100;

B) variable_integer =100;

C) int[] variable_integer=100;

8. What is the function delay is useful for ?

A) A delay is used to do a break in the program with time in (ms)

B) A delay is used to do a break in the program with time in (s)

C) To execute an instruction during a determinate time

9. What the program will write on the serial monitor?

int a=2;
int b=5;

void setup() {
  Serial.begin(9600);
   for (int i = 0; i < 3; i++) {
    a=a+b;
    Serial.println(a);
  }
}

void loop() {
}

A) 7, 11, 14

B) 8,10,20

C) 7,12,17

10. What is the function to have the absolute value of a number in Arduino Language?

A) round()

B) abs()

C) sqrt()

Correction of the quizz

We will see now the answers of the quizz:

  • Question 1

The good answer is b), the void setup and void loop. Theses both functions are mandatory in an Arduino program. Forget to write one will create you an error.

The void main is a mandatory function for the C language.

  • Question 2

The good answer is a), the function is used to initialize pins, the serial monitor. For the answer b), you have to initialize the library before the void setup.

  • Question 3

The right answer is a), #include. You can read our course on the libraries.

  • Question 4

The right answer is b), assign a value to the digital pin. You will need it to control your component. To read the value from a pin you need the function digitalRead. The assign a value to an Analog pin you need AnalogWrite.

  • Question 5

The right answer is b), AnalogRead is used to read values from the sensor. 0 correpond to 0V and 254 to 5V.

  • Question 6

The right answer is b). The # is used to initialize the library.

  • Question 7

The right answer is a). You can read our course on the integer variable if you wan to know more about it.

  • Question 8

The right answer is a) : A delay is used to do a break in the program with time in (ms). There is another function called delayMicroseconds(us). With it you can do break with a time in microseconds.

  • Question 9

the right answer is c) : 7,12,17. You can look at our course on the for loop.

  • Question 10

The right answer is b). We have done a course on the mathematics functions on Arduino language if you want to see all the functions available on Arduino language.