WEBVTT

00:00.210 --> 00:04.450
Let's now add the ultrasonics insult to our suit.

00:04.800 --> 00:09.840
So, again, first I'm going to do this on Tinker Cat and then show you with the real secret.

00:10.470 --> 00:16.070
So we're going to start not from an empty secret, OK, but we're going to start from the previous one.

00:16.080 --> 00:23.630
So the three areas where you have three, it is one potential murder and one push-Button connected to

00:23.640 --> 00:24.000
the original.

00:24.060 --> 00:26.160
So I'm going to duplicate that one.

00:28.760 --> 00:29.720
And they meet.

00:30.930 --> 00:32.910
OK, so Nick.

00:34.890 --> 00:35.490
Syncytial.

00:37.250 --> 00:43.580
All right, and let's find the ultra sonics and so in the component lists, I'm just going to take ultra

00:43.730 --> 00:45.150
sonic, OK?

00:45.180 --> 00:49.480
And you may see a few different ultrasonic components here.

00:49.730 --> 00:57.980
And actually, the one we are going to use is that what the H c dash s are OK for?

00:58.310 --> 01:02.360
OK, there is another one, which is not the same one.

01:02.360 --> 01:05.170
And you can see this one has only three things.

01:05.570 --> 01:08.390
However, the one we are using has four things.

01:08.540 --> 01:10.020
So remove this one.

01:10.460 --> 01:12.320
Just use that one.

01:12.320 --> 01:13.670
The H c.

01:13.970 --> 01:16.000
S are ok for OK.

01:16.580 --> 01:18.360
And what do we have here.

01:18.380 --> 01:20.350
So we have four different things.

01:20.720 --> 01:25.250
We have this is C, which is power, which would go directly to Five-fold.

01:25.820 --> 01:29.200
On the other end we have Genndy which is grong great.

01:29.210 --> 01:35.570
So we have ground, we have possibly and then we have two more pins here in the middle we have three

01:35.600 --> 01:38.210
which is Trigorin and equal.

01:38.510 --> 01:44.360
OK, so we are going to use I'm going to explain to you just a little bit later in the form listen how

01:44.360 --> 01:47.050
to use those two things basically to trigger pain.

01:47.300 --> 01:51.920
We are going to use it as an output to trigger the sensor and then the equipping.

01:52.010 --> 01:56.360
We are going to receive the data on that beam to get the distance.

01:57.020 --> 01:58.580
So let's connect.

01:59.530 --> 02:03.860
I'm going to put it here and have.

02:05.080 --> 02:06.370
Left, OK.

02:06.490 --> 02:14.110
Let's start by connecting the ground, the ground is here, all this line, I'm going to take the line

02:14.110 --> 02:17.620
here, the last one and do this.

02:17.620 --> 02:22.840
And actually what I'm going to do here, I'm going to make a small modification, so I'm going to put

02:22.840 --> 02:23.230
that.

02:24.440 --> 02:28.370
Here, I'm going to modify this wire here.

02:32.920 --> 02:35.110
So by clicking, you can add one dot.

02:39.430 --> 02:45.340
And I'm going to modify this year and one that year.

02:47.450 --> 02:48.800
That when we go here.

02:52.700 --> 02:56.840
And that when we go here, so I have just modified the secretes.

02:59.450 --> 03:01.290
So that's the exact same thing.

03:01.310 --> 03:06.590
OK, I've just connected the ground to a different pin and obviously two different being on the same

03:06.590 --> 03:09.590
line, OK, and that one is still connected to the ground.

03:09.770 --> 03:18.440
So I can just do this, connect the ground of the sensor to the ground here directly.

03:19.990 --> 03:29.230
And let's pretend like, OK, let's take the vesi on the second spin and let's connect it to this issue

03:29.380 --> 03:30.760
here with.

03:31.240 --> 03:31.630
Right.

03:32.980 --> 03:39.820
OK, and then we have the two beans here, so the trigger pin and eco thing, I'm going to connect the

03:39.820 --> 03:46.480
A.P. on digital pin number three, the Equipe handling of the ECOFIN.

03:46.480 --> 03:51.160
And let's let's find a way like this.

03:56.300 --> 03:57.600
OK, let's change.

03:57.620 --> 03:58.130
Carol.

03:59.390 --> 04:09.140
To four people, so make sure you use different colors so you don't mix the wires together and then

04:09.140 --> 04:17.350
so the equipment on number three and trigger pin, so that one, I'm going to take it and put it on

04:17.360 --> 04:19.150
PIN number four.

04:19.940 --> 04:21.040
Let's do this.

04:22.830 --> 04:23.850
In number four.

04:25.940 --> 04:32.130
And it's changed color also to Brown, OK, Brown looks good.

04:33.080 --> 04:38.700
So, as you can see, the more components you add to your secret, the more it can look a little bit

04:38.720 --> 04:39.310
messy.

04:39.770 --> 04:42.740
But with the correct colors, you should be fine, OK?

04:42.770 --> 04:47.930
Make sure that, of course, all of these dots are connected together.

04:48.200 --> 04:51.470
OK, here, all the grounds are connected together.

04:51.590 --> 04:52.460
OK, that's good.

04:53.090 --> 04:57.770
Then make sure you don't mix the wires together, ok.

04:57.820 --> 05:00.070
And the secret is done just one thing.

05:00.320 --> 05:06.500
So for the trigger and Escorpion, you can basically choose any digital thing, but actually not for

05:06.500 --> 05:12.230
the Equipe because for the eco pin, the PIN number three, if you remember on the adeno, is also a

05:12.230 --> 05:14.810
pin that can handle interrupts.

05:14.940 --> 05:17.660
OK, so you have been two and three that can handle.

05:18.590 --> 05:24.830
So it's important you plug the eco pin on an incorrect pin as well.

05:24.860 --> 05:31.460
OK, so if you have you know, that means in two or three, if you have a different ball, just check

05:31.460 --> 05:36.780
the listen on the interrupt section to see what pins you can use.

05:37.420 --> 05:37.760
Right.

05:38.300 --> 05:39.600
And now I'm just going to show you.

05:39.620 --> 05:46.700
So if I just start the code here, actually, let's remove any code we have.

05:49.440 --> 05:56.920
Run the code with nothing, just going to show you how you can use the ultrasonic sensor.

05:57.110 --> 06:04.520
So if you click on the ultrasonic sensor, you can see here, so you have the range with the angle and

06:04.520 --> 06:07.410
the range of where you can detect an object.

06:07.450 --> 06:11.240
OK, you can see here one hundred and thirty centimeter.

06:11.240 --> 06:14.410
You also have the range in inches, OK?

06:14.510 --> 06:17.410
And you can see you can move the objects.

06:17.420 --> 06:23.590
So you will be able to use this, OK, because in real life we will be able to do a real hardware.

06:23.600 --> 06:30.160
We will be able to measure directly by putting our hand on a wall on objects with simulation.

06:30.170 --> 06:36.860
You just put on the circuits with a simulation, you click and then you will be able to get an object

06:37.280 --> 06:38.780
in the range of the sensor.

06:39.110 --> 06:39.500
All right.

06:41.570 --> 06:46.290
And here is the real hardware secret with the ultrasonic sensor.

06:46.670 --> 06:53.120
So I have put the address and sensor here and so you can see we have the four different beams of ground,

06:53.120 --> 06:59.480
echo, trigger and viscously, and each one, which each is connected to a different line.

06:59.540 --> 07:03.310
OK, you can see here make sure you connect each to a different line.

07:03.320 --> 07:04.280
That's very important.

07:04.910 --> 07:09.710
Now, I have also but as you can see here with this on this direction.

07:09.830 --> 07:14.360
OK, so the sensor doesn't face any other component.

07:14.390 --> 07:18.840
OK, that's very important because with this and so we're going to measure a distance.

07:18.900 --> 07:21.450
OK, so the distance, for example, from my hand.

07:21.650 --> 07:29.270
So if you put it the other way or if you put it near something else, then you will always get an object

07:29.480 --> 07:33.190
in the middle and then you can't measure an accurate distance.

07:34.290 --> 07:36.870
So I have got to keep, as you can see here.

07:36.900 --> 07:42.260
So first, of course, the wire is disconnected and I have connected the ground.

07:42.270 --> 07:49.350
So the first you can see here ground here to the ground line, which is connected to the ground of the

07:49.350 --> 07:49.730
area.

07:50.220 --> 07:58.740
I have been connected the opposite and with the small right wire to the plus line with D.C., which

07:58.740 --> 08:01.460
is connected to five of them.

08:02.100 --> 08:09.140
And then I have so we have here you can see AECO first when he is on the right is coping, OK?

08:09.240 --> 08:12.080
So make sure you correctly check AECO is here.

08:12.120 --> 08:22.230
OK, you put Echo here and you go to PIN number three on the Alvino and then the trigger being OK,

08:23.070 --> 08:24.320
trigger that one.

08:24.330 --> 08:26.550
So make sure you get to the trigger.

08:26.550 --> 08:29.220
The same line as trigger pin goes to.

08:29.220 --> 08:33.810
I have chosen the orange wire goes to pin number four.

08:34.670 --> 08:37.310
OK, so that's four new wires.

08:37.320 --> 08:45.930
OK, one way out of the ground, one to see which is five-fold and then pin on pin number three which

08:45.930 --> 08:50.420
has the interrupt functionality and trying to pin on pin number four.

08:50.700 --> 08:52.320
And that's pretty much it.
