Hello and welcome to the stimulus on Energy are going to explain how to deal with analog and both VSP
30 toolbelt now to test the input analog value signals.
There are about 18 12 with ADC input channels.
You can easily recognize them from the wiring diagram, the one that we already mentioned, all of the
pain out there that we explained in a previous lesson, and there is only one thin bit and a digital
converter on the MCU.
Now, depending on the ball that you are using, this pen can be at a different location.
Let me show you the pin out now, as you can see in this image.
You can see the ADC.
Pins, so all of these are our digital converter enabled pens and there are other pens as well.
Again, here's AC1 and Aissatou, so different channels and you can recognize them, was with the general
purpose input output PIN number starting from PIN.
As you can see here, a pin to has ADC pin for PIN 15 PIN one doesn't have ADC.
So it's something from point zero then you can move on.
That has been to for 12, 13, 14, 15 and so on.
We only need one pin for this lassonde.
So to read that and what you will use the same as an Arduino boards, we will use the analog read function
and our coding.
Now, as you can see, the pain that we are going to use for this example is general purpose input output
36.
It has eight one six zero or Channel zero now to release value.
We need to use the analog read function and we saw the analog value on a variable.
It's very important to note that the speed 32 analysts are convertor have 12 bits of resolution versus
10 bits on E.S.P eight two, six, six and Arduino.
So the total range of the analog to digital conversion readings can go to 4000 zero nine five or 095
five instead of 1000 zero twenty seven on Arduino and SB eight two six six, when a maximum of three
point three volts is applied to its input.
So you can expect more values that can go up to 4000.
Now for input, let's use, I think, your on potential meter or any analog sensor that we have and
we can connect it from the three point three volt and ground.
Now let's use its variable output to be the input of the E.S.P 32 ADC bands to get started.
Let's open up our software.
Go Arduino IVI.
Now, after opening up Padrino Idee.
OK, let me open up the other software.
OK, here it is.
Hardware and software.
Now, the first step that we are going to do is create a new sketch, let's make sure that our board
is connected and recognized, as you can see, at Confort, and let's make sure that we have the right
port selected.
Our case, SPF 30 to.
As you can see, do it as we set it to the gate and we have other libraries that can cover this.
Now, this is our board.
Let's start coding, the first thing that we need to do is go to the void setup and initialize the serial
communication serial again
and we can choose any moderate.
Let's choose eleven thousand five hundred five thousand two hundred.
Um, now let's add a delay so that this kind of supplies.
The CIA communication with your print, a sentence indicating that we are using E.S.P.
32 analog interest now up here, let's initialize a variable, save the data, so end analog value.
Equals zero, then inside the void loop, right, and value equals and an agreed, just like an Arduino.
And from here, we need to select a pin.
In our case, it's the general purpose.
And what output?
PIN 36.
After that, let's print the analog read value, so cereal that print.
Now, that's based out of creed, which has done a value and it's solidly.
Five hundred milliseconds.
OK, let's verify.
Let us save the codes, let's call it a..
It will take some time to compile a sketch.
Now, let's upload the sketch to our E.S.P board, make sure that your boards connected.
And you have selected the right board and the right comport.
OK, as you can see, it's uploading.
OK, writing, OK, done uploading now if we went and open up here, Serializer.
OK, we have this science chance, the moderate to.
Hundred fifteen thousand two hundred, as you can see here, we have zero value now, if you played
with the analog potential meter, you will get values up to 4000 and that's it.
This is how easy it is to use analog pins on the USB port, the same Arduino coding, same structure.
And I would have every line.
Thanks.
Watching this last one, if you have any question, please ask in the Q&A about.