Actually, that's not all for another piece you have seen that you can use analog input to a range of
values from an analog sensor, but analog things are, in fact, also digital.
So by default, if you don't set a model for an analog pin and use the grid function, then it would
work as an analog input pin.
But then you can also use ping mode to choose a mode and use the pin, just like you would use a digital
pin.
For example, you can connect an energy to an analog pin in your code.
You could use B mode with output and then you can give high and low values to actuate, just like we
did before.
Note that for analog things like I have previously said, you can't use the same functionality are.
In other words, the analog right function.
Using an analog print as a digital pen can be very useful.
For example, if you need to connect a new digital component and all your digital pins are already used.
So what I recommend by default is to use digital pins when you have a digital component.
OK, and I know because when you have an analog sensor by not mixing them, you will keep things clearer
for you.
And of course, if you need a more digital things, then go ahead and use an analog pin as a digital
pin.
So just to show you how you can use another pin as a digital pin.
Well, I'm going to go back to the front secret that we have here and just change the pin for the Eddie.
All right, so now the energy is going to be, as you can see, to pin number 11.
I'm just going to change that a little.
Let's remove it.
That's directly connected.
So this leg of the resistor to switch, make it lean in, that's connected actually to a pipe.
So the energy is now connected to an analog in effect.
And the rest of the circuit here doesn't change.
And let's really find the real secret as well to make the test.
And so I have disconnected and you know, and here we have so we have this where we're going to change
this for you, which is connected between one leg of there is this talk here which is connected to the
entity and PIN number even here.
So I'm going to connect it to be number eight five over there instead, because this wire is quite small.
I'm going to use a longer one.
So I'm just going to disconnect this.
But this year instead.
Yeah, I like correct.
That and then all the way to a buy last on this wall here.
All right.
And now let's simply make this and blink, so I'm going to open the.
So go back to your programs, go back to the program.
And so here we make the energy building and just going to remove that construction.
OK, so we just set up the energy as an output beam we demoed and then we just make it blink every five
hundred milliseconds instead of 12.
I'm simply going to write a five.
OK, so as you can see, the code is the exact same if we use the energy on a digital pin or another
pin.
But just because we use this, we spin mode with any dippin an output, then this analog will behave
just as a digital thing.
Just don't forget, without the Pelago, um, functionality, let's upload code and.
Actually, it's better if I plug my in arianism so you can see you will get these are all, for example,
bought at CM five is not available, so now it is plugged in.
I can upload the code.
And well, as you can see, the Elvie is blinking OK, just like it was previously.
So we have successfully used another pin as a digital pin and.
All right, that's the end of the section on Wrapping's.