Hello, guys, and welcome back.
Now it's time to add our animal control.
So how can we read an elk?
As you have seen, we have wired our not MCU with a potential meter.
That's a great.
But how are we going to add this and send it to our Android app?
It's actually very simple.
All we need to do here is first read the analog.
Then how do you read an analog pen for them to you?
It's also very simple.
You remember the analog read function?
We just read a zero.
And we stole this in a valuable let's say that it's called integer.
But.
Next, we need to send this value to blink.
How can we do that?
Well, it's also very simple, we can just try to blink.
That.
Virtual riot.
And we're going to ride that to a virtual zero and then we're going to send the value of what?
OK, now I'm going to show you what does this video mean and what is this virtual right in a second.
Now, there is digital pens, analog pens and virtual pens, virtual pens all the way to read valuables.
I know here you could have said why you're not just directly reading from the analog pen and why we're
not using that.
Well, why are we buffering it and sending it to a virtual right right here?
Because I want to teach you as well about virtual right, which is about reading valuables.
So let's say you have a valuable and you want to read it.
You're defined.
It's valuable.
You said it's value and then you send it to a virtual pen using virtual.
Right.
OK, so you just put virtual right.
You said the number of the pen here could take between zero and the 254 or 255.
We will check the exact number in a minute.
And then you just put the variable you wanna be sending to your app.
In our case, I want to send what is the value of my potentia meter.
OK, that's it.
This is all we need to do.
Now, let me upload this and we are done uploading.
Now let's go to the end.
So now we are in the end, decide.
Now, if you click on that square, you're going to go to the editing mode.
Now click on Plus and let us choose visual display.
Here is my virtual display.
Now, if I Double-Click on it, I'm going to be able to check what I am going to read here in my case.
You remember, my Arduino is sending a virtual pen and it's sending to Pen V0.
Remember I told you that you can send to pens up to 255, maybe check it.
It is from zero up to 255, so you can send 256 variables to this virtual pen, that's a large number.
So let us go back to zero, because this is what we have set in our sketch.
So this is virtual and this is V zero.
And as you can see, the range of values is between zero and a thousand to 23.
And that's normal because we could also increase the range here if our variable is sending larger values.
Now, the reading grade can be specified.
So how often do you want to read?
Is it every one minute?
Is it every 30 seconds?
Let's say it is a bomb push.
That means whenever there is a new value, I'm going to receive it.
And that's it now in the next lecture.
We're going to test this together.