WEBVTT

00:00.150 --> 00:02.030
And here is the complete code.

00:02.040 --> 00:06.590
So after September 11 for the simulation as well.

00:06.720 --> 00:13.680
So the only difference here is that for the iPod Remote Library, I use Division two and Division three

00:13.680 --> 00:16.560
because that's what's on the available with Dinko.

00:17.160 --> 00:19.290
So very quickly, what are the differences?

00:19.320 --> 00:21.550
Well, you can see the button mapping is different.

00:21.570 --> 00:23.040
I don't use decimal numbers.

00:23.040 --> 00:29.000
I use hexadecimal numbers with zero X, so I have marked here previously the button.

00:29.010 --> 00:32.050
We have done that previously in a previous section.

00:32.460 --> 00:37.950
So when you map the button to make sure you take the hexadecimal value, just the decimal value and

00:37.950 --> 00:42.990
you put that here, but that will be different, of course, from the simulation and the real hardware.

00:43.620 --> 00:47.580
Then I have some here specific to version two.

00:47.760 --> 00:55.410
I have those two lines to initialize the I receive and decode the results here and then everything is

00:55.410 --> 00:56.010
the same.

00:56.010 --> 01:05.850
I just go to the void setup and I have a different way to initialize the implied receiver as well as

01:05.850 --> 01:13.140
in the loop, a different way to read the results that value and to decode function is different.

01:13.380 --> 01:18.210
So you only need to change those few lines of code if you want to toggle between the version two and

01:18.210 --> 01:21.040
three of the library and then the rest is the same.

01:21.060 --> 01:27.210
Make sure you use long for the command and know I'm going to start the simulation by racing here and

01:27.360 --> 01:29.370
the code you can see initializing.

01:30.500 --> 01:38.020
And then distance, you have the distance here, and with this you can set a different distance.

01:38.060 --> 01:40.390
You can see no obstacle here.

01:40.470 --> 01:43.550
We have a we we have a warning.

01:44.610 --> 01:46.620
Warning and if we go closer.

01:47.890 --> 01:54.950
Well, as you can see here, well, we don't have necessarily the minimum threshold, so you may lower

01:54.950 --> 01:56.620
added threshold to test.

01:57.790 --> 02:05.860
OK, because it seems that we can't reach 10 centimeters, so I'm going to stop code and we just have

02:05.860 --> 02:09.780
one thing to change is here to knock distance.

02:09.790 --> 02:10.990
Let's between.

02:13.250 --> 02:14.320
And it started in.

02:16.450 --> 02:18.670
Because for some reason, this senseor here.

02:20.840 --> 02:30.150
But less than here, like 20, something like this, so we go down and let's see what we can get here.

02:30.980 --> 02:37.190
Thirty one twenty, an obstacle to a lot less than 20 centimeters.

02:38.490 --> 02:42.210
So to unlock, I can just press on the button here.

02:43.100 --> 02:49.860
Of course, I need to move the obstacle first race on the pushbutton and I can unlock.

02:51.800 --> 02:53.240
And as you can see, that's quite long.

02:53.340 --> 02:59.970
OK, look at the simulation, the simulator time here is not really that fast, OK?

02:59.990 --> 03:02.710
It's quite long to just simulate once again.

03:03.080 --> 03:06.120
And this is because, well, we have quite a lot of code now.

03:06.140 --> 03:08.120
This application is a little bit more complex.

03:08.480 --> 03:11.260
So you can see the limitation of the simulation.

03:11.270 --> 03:18.800
It's working nice, but for a more complex set up and more complex project like this, this might not

03:18.800 --> 03:19.840
be as optimal.

03:20.660 --> 03:21.220
So.

03:21.230 --> 03:23.850
Well, now I can use any of the other functions.

03:23.870 --> 03:32.100
Okay, so here this really if I increase the brightness here, you can see the energy is so if with

03:32.150 --> 03:39.970
the luminosity the brightness is lower and then I can toggle between the different modes price on off,

03:39.980 --> 03:44.160
I can see the luminosity from the photoresistor.

03:44.720 --> 03:52.870
You can see date in real time almost because well the simulator is quite slow right now, OK.

03:53.360 --> 03:57.390
And if I go back to settings I can erase it.

03:57.410 --> 04:01.820
The settings settings have been read it go back to the distance.

04:02.370 --> 04:06.680
I can see so I can just but inches I can reset.

04:07.890 --> 04:11.970
The problem here, and you see it still OK?

04:12.300 --> 04:14.830
So everything works just like we do.

04:14.850 --> 04:15.350
We all have.
