Let's now see how to actually use the digital bin with a bit of information on the arena, and we are
going to use the analog right function that I'm going to explain to you in just a minute.
But first, we need to change something in our seconds.
Why is that?
But we have our land, which is correct, upload to the original.
But if you look at the thing here, we have the energy to pin number 12, OK?
And the PITIABLY wind function is only available here when you see the Tildy.
OK, so for example, being number 11, 10, nine here would do, but not being number 12.
So if you want to be able to use the analog right function for this LCD, OK, to provide a bit everything
you need to change the beat.
So what I'm going to do is simply so I click on the wire here and there is this dot that I'm going to
change here, the pin number either.
All right.
Nothing else to change.
OK, we just changed to digital for the 80s and now the and it is connected to something that has the
P value and function so we can start to write the code and how to change the pin on the real how know.
Well, it's quite simple.
So first, make sure that you are unplugged your doing about.
And then you simply so you don't change anything, you simply unplug here this way, which is on number
12 and you just put it on number 11 right here, and that's it.
And now back to the original 80s, so if you want, you can also do that directly on Jinkx Acad.
So back to the 80s and you can plug the air in about your computer and make sure you have the correct
board and the correct port here.
And let's see how to use this analog function.
So I'm going to remove hear the comments.
And first, as usual, I'm going to use a defined OK for the energy.
So this time it's not too old.
This time it's either.
Now in the setup function, what I need to do is spin mode.
And in.
Output is slow to initialize the pin, OK, to set the node for the pin, as you could see in the diagram
in the previous lesson.
We still need to set the pin to output mode.
OK, whether you use digital right are another great.
You still need to set the mode as output.
So now the pin has been initialized in the setup function.
Lets directly use the analog.
So analog.
Right, OK, you can see it arranged like this.
So analog and then uppercase w I open the parentheses if I need to provide first.
The PIN number ended in just like we did in digital, right, and then in digital, right, we directly
set high or low states, but we are not afraid we are going to provide a number or an integer number
between zero and 255.
So let's test.
Let's say 20.
So I took the brunt of this and don't forget that semicolon.
So here the program, we simply initialize the entity and set an analog value so applicable to him with
a duty cycle.
OK, which is twenty out of two hundred and fifty five, which is a little bit less than 10 percent.
OK, and let's actually compile and upload the code.
I'm going to name it analog.
Right.
And as you can see, the energy is poured on, but the intensity is quite low.
OK, now let's test with 200, which corresponds to about 78 percent of the power between the intensity
here should be much stronger.
Let's try that.
All right, and as you can see, your editing now is pulled out again, but with higher intensity.
So you can try all kinds of value, OK, between zero and two hundred fifty five to see how the brightness
changes with different values.
And now let's let's try to two special values, which are zero zero zero persons.
So if you.
Tend not to operate with zero, the energy will simply be pulled of and we've 255, the energy will
be powered on with the five volt OK, which is just what you would do with digital.
Right, and high state.
All right.
So as you can see, another right function is not that complicated.
Make sure that the thing you try to use with energy, right.
Has a p value and function, otherwise it won't work.