WEBVTT

00:00.150 --> 00:07.080
When you start your I.D., you indirectly get a new amnesty program, but you can see here, in fact,

00:07.080 --> 00:08.830
the program is not really empty.

00:09.150 --> 00:14.690
It already contains two functions void setup and void loop.

00:15.630 --> 00:17.980
If you don't know what functions are.

00:18.360 --> 00:22.090
Don't worry, I'm going to cover that a little bit later in the course.

00:22.770 --> 00:29.220
So for any original program you create, this is the minimum code you should have.

00:29.880 --> 00:38.490
If one of those functions is missing, you won't be able to compete in the code, do you, on a board.

00:38.940 --> 00:46.530
And when creating your own program, you will write some code inside each of those functions.

00:46.860 --> 00:50.630
This code will then be executed on the Arab world.

00:51.360 --> 00:55.500
So the first thing you can see is that the functions are empty.

00:55.700 --> 01:00.330
OK, so when you run the program, what will happen?

01:00.960 --> 01:07.920
So first of all, if you put any instruction here at the beginning of your program, this will be executed

01:08.190 --> 01:12.930
and then the void setup function will be executed first.

01:13.170 --> 01:23.130
So whatever code you put between those two curly brackets here will be executed first after it is executed

01:23.130 --> 01:25.140
once and only once.

01:25.740 --> 01:34.570
The code inside the void loop function will be executed in what we can call an infinite loop.

01:34.920 --> 01:41.730
So basically all the code here will be executed and once it is finished, it will be executed again

01:41.730 --> 01:43.860
and again and all of that again.

01:44.070 --> 01:51.450
So first, the code in the void setup executive wants and then the code in the void loop is executed

01:51.450 --> 02:00.870
an infinite number of time until you simply restart the program or you shut down your arduino and inside

02:00.880 --> 02:01.620
the function.

02:01.640 --> 02:07.290
So inside the void set up, for example, the instructions will be executed line by line.

02:07.320 --> 02:10.740
So first line five and then line six, etc..

02:11.100 --> 02:13.890
As you can see, we already have some text here.

02:13.890 --> 02:15.780
But this is not code.

02:16.110 --> 02:17.810
This is just a command.

02:18.030 --> 02:19.380
So we've double slash.

02:19.620 --> 02:23.140
You can actually create some command if output doubles.

02:23.730 --> 02:27.750
I can just create any comment I want.

02:28.080 --> 02:33.200
This is very useful for you to improve the credibility of your program.

02:33.210 --> 02:38.980
OK, so you can put some command to give some indication of what's happening in your code.

02:39.480 --> 02:45.680
OK, in the same folder, void loop function, all the lines will be executed one by one.

02:45.960 --> 02:48.480
And this is also a command line.

02:49.140 --> 02:54.330
So we're going to come back to those functions quite a few times in the schools.

02:54.630 --> 03:02.820
But basically what you would write inside the void setup function is the code to initialize your program,

03:03.030 --> 03:09.180
for example, to initialize valuable, to set up a sensor, to set up a communication.

03:09.540 --> 03:14.190
So everything that you need to set up at the beginning of your program and that you basically need to

03:14.190 --> 03:19.410
set up once and then in the loop function, you rewrite your application code.

03:19.590 --> 03:27.570
So that would be the code that we learn all over again until the admin board is powered off, all restarted.
