Let's now add the ultrasonics insult to our suit.
So, again, first I'm going to do this on Tinker Cat and then show you with the real secret.
So we're going to start not from an empty secret, OK, but we're going to start from the previous one.
So the three areas where you have three, it is one potential murder and one push-Button connected to
the original.
So I'm going to duplicate that one.
And they meet.
OK, so Nick.
Syncytial.
All right, and let's find the ultra sonics and so in the component lists, I'm just going to take ultra
sonic, OK?
And you may see a few different ultrasonic components here.
And actually, the one we are going to use is that what the H c dash s are OK for?
OK, there is another one, which is not the same one.
And you can see this one has only three things.
However, the one we are using has four things.
So remove this one.
Just use that one.
The H c.
S are ok for OK.
And what do we have here.
So we have four different things.
We have this is C, which is power, which would go directly to Five-fold.
On the other end we have Genndy which is grong great.
So we have ground, we have possibly and then we have two more pins here in the middle we have three
which is Trigorin and equal.
OK, so we are going to use I'm going to explain to you just a little bit later in the form listen how
to use those two things basically to trigger pain.
We are going to use it as an output to trigger the sensor and then the equipping.
We are going to receive the data on that beam to get the distance.
So let's connect.
I'm going to put it here and have.
Left, OK.
Let's start by connecting the ground, the ground is here, all this line, I'm going to take the line
here, the last one and do this.
And actually what I'm going to do here, I'm going to make a small modification, so I'm going to put
that.
Here, I'm going to modify this wire here.
So by clicking, you can add one dot.
And I'm going to modify this year and one that year.
That when we go here.
And that when we go here, so I have just modified the secretes.
So that's the exact same thing.
OK, I've just connected the ground to a different pin and obviously two different being on the same
line, OK, and that one is still connected to the ground.
So I can just do this, connect the ground of the sensor to the ground here directly.
And let's pretend like, OK, let's take the vesi on the second spin and let's connect it to this issue
here with.
Right.
OK, and then we have the two beans here, so the trigger pin and eco thing, I'm going to connect the
A.P. on digital pin number three, the Equipe handling of the ECOFIN.
And let's let's find a way like this.
OK, let's change.
Carol.
To four people, so make sure you use different colors so you don't mix the wires together and then
so the equipment on number three and trigger pin, so that one, I'm going to take it and put it on
PIN number four.
Let's do this.
In number four.
And it's changed color also to Brown, OK, Brown looks good.
So, as you can see, the more components you add to your secret, the more it can look a little bit
messy.
But with the correct colors, you should be fine, OK?
Make sure that, of course, all of these dots are connected together.
OK, here, all the grounds are connected together.
OK, that's good.
Then make sure you don't mix the wires together, ok.
And the secret is done just one thing.
So for the trigger and Escorpion, you can basically choose any digital thing, but actually not for
the Equipe because for the eco pin, the PIN number three, if you remember on the adeno, is also a
pin that can handle interrupts.
OK, so you have been two and three that can handle.
So it's important you plug the eco pin on an incorrect pin as well.
OK, so if you have you know, that means in two or three, if you have a different ball, just check
the listen on the interrupt section to see what pins you can use.
Right.
And now I'm just going to show you.
So if I just start the code here, actually, let's remove any code we have.
Run the code with nothing, just going to show you how you can use the ultrasonic sensor.
So if you click on the ultrasonic sensor, you can see here, so you have the range with the angle and
the range of where you can detect an object.
OK, you can see here one hundred and thirty centimeter.
You also have the range in inches, OK?
And you can see you can move the objects.
So you will be able to use this, OK, because in real life we will be able to do a real hardware.
We will be able to measure directly by putting our hand on a wall on objects with simulation.
You just put on the circuits with a simulation, you click and then you will be able to get an object
in the range of the sensor.
All right.
And here is the real hardware secret with the ultrasonic sensor.
So I have put the address and sensor here and so you can see we have the four different beams of ground,
echo, trigger and viscously, and each one, which each is connected to a different line.
OK, you can see here make sure you connect each to a different line.
That's very important.
Now, I have also but as you can see here with this on this direction.
OK, so the sensor doesn't face any other component.
OK, that's very important because with this and so we're going to measure a distance.
OK, so the distance, for example, from my hand.
So if you put it the other way or if you put it near something else, then you will always get an object
in the middle and then you can't measure an accurate distance.
So I have got to keep, as you can see here.
So first, of course, the wire is disconnected and I have connected the ground.
So the first you can see here ground here to the ground line, which is connected to the ground of the
area.
I have been connected the opposite and with the small right wire to the plus line with D.C., which
is connected to five of them.
And then I have so we have here you can see AECO first when he is on the right is coping, OK?
So make sure you correctly check AECO is here.
OK, you put Echo here and you go to PIN number three on the Alvino and then the trigger being OK,
trigger that one.
So make sure you get to the trigger.
The same line as trigger pin goes to.
I have chosen the orange wire goes to pin number four.
OK, so that's four new wires.
OK, one way out of the ground, one to see which is five-fold and then pin on pin number three which
has the interrupt functionality and trying to pin on pin number four.
And that's pretty much it.