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
A) Void main
B) Void Setup and Void Loop
C) Only Void loop
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.
A) #include
B) //include
C) #include “Library.h”
A) To read a pin
B) To assign a value to the digital Pin
C) To assign a value to the analogue Pin
A) From -1 to 5
B) From 0 to 254
C) From -1 to 1
A) #My comment
B) // My comment
C) % My comment
A) int variable_integer =100;
B) variable_integer =100;
C) int[] variable_integer=100;
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
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
A) round()
B) abs()
C) sqrt()
We will see now the answers of the quizz:
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.
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.
The right answer is a), #include. You can read our course on the libraries.
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.
The right answer is b), AnalogRead is used to read values from the sensor. 0 correpond to 0V and 254 to 5V.
The right answer is b). The # is used to initialize the library.
The right answer is a). You can read our course on the integer variable if you wan to know more about it.
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.
the right answer is c) : 7,12,17. You can look at our course on the for loop.
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.