Hello and welcome this new Arason.
Now let's start by quoting the first method.
First, we need to read the incoming data.
So light humidity, low humidity equals DHT, which is the object that we already find, seed humidity.
And the next one is for float for that temperature.
By DHT dot read.
Then, Richard, now we have the humidity and temperature to send them, we can easily use the Vishwa
light function.
The original Blinkx Library has a method called Vishwa Right, which is used to drive the sensor reading
into virtual bins.
We have or we will define and configure and our link up.
So to do this, simply write blank dot virtual.
Right.
Now, first, define the virtual pen, let's call it V..
Five, and we will send humidity.
And we will do the same for the temperature.
Let's call it the V for.
And let's and the temperature in which.
That's it.
Now, this is the first function, now the second function, what we will do in the second function
is basically the same thing.
We will be the water level.
And we already define two variables here and here.
So the water level will equal unallowed read function.
And this will equal analogue.
Right now, we need to bring the two variables here, water level, sensor pin number and the salt and
salt and no.
Now we have two analog readings, and to map them, we can easily use this function you cut at water
level.
Equal mob and inside the mob, you can add water level and the range zero 2000 zero.
Twenty five now, the same thing can be done for the.
Moisture level will equal mud and we will do the very same thing, we will write more Circleville and
we will add zero 4000 zero twenty five or let's make it 20 hundredths.
Make this one.
Now, this these values are depending on my sensor readings and the range that I want to get.
Now, depending on your type of sensor data sheet, you need to make sure that you are choosing the
right values.
Now to know.
The Arduino malfunction.
Let's take a quick look at its description now, the map is basically a way to create maps, a number
from one range to another that is available from law would get map to law now.
It does not constrain values to within the range because out of range values are sometimes intended
and useful, that constrains function may be used either before or after this function if limits to
that energies are desired, depending on your end goal.
You can either use the constraints function or don't use it.
Now, I can see here the map will take a value and from law from high to low and too high.
So it will turn the value from law to law.
As you can see this to this and from high to high, as you can see from this to this.
Now the value is the bottom up from low, the lower bound of the values current range from high, the
upper bound of the values current range to low, the lower bound of the values target range, the one
that we want to high, the upper bound of the values target range.
Now, as you can see, this is an example code.
We are mapping an analog value to eight bits, zero to 255.
As you can see here, we are reading the value and here we are getting the readings from zero to one
thousand twenty three.
And we want them to be map to zero to 255.
So one thousand twenty three will provide an output of two hundred fifty five and it will be stored
the value here.
So it's basically a way to change from this range to this range, as you can see.
And we are using the very same methodology here.
We are moving the values from this range from zero to two thousand to this range from zero to twenty.
And here we are moving the values from zero to 4000.
So this range from zero to twenty.
And it's a very easy, straightforward and easy to implement way to change the range from a very large
range to a very small one.
And they will both provide the very same final result.
Now, this is regarding the mapping, and since we now have the water level and moisture level, we
can easily send the values using the uplink, the virtual.
Right function here we have seven.
Walter Lippmann.
And here we have.
Let's say v six.
To send the most.
Hello.
Now, let's verify the code to make sure that we don't have any spelling or.
Missing a.m. column for moving forward.
OK, now, as you can see here, we have another.
We have seen here.
OK, here we have another cynical because I'm quoting and see Python and Java.
Sometimes.
Such mistakes happens because, as you know, Python doesn't have a semicolon at the end of each sentence.
OK.
Now, done combining everything is right now, we can add an extra step here in this area and this extra
step will make sure that we are getting readings from the DH sensor.
But if you have connected correctly, you won't need this step.
You can add an if statement.
If you are getting readings from the humidity and temperature, then move on.
If not, then plant a cereal line, fail to read data from the sensor and you can do the same here.
But I don't think that we need them now.
We need to make sure that we memorize these numbers.
We will give back to them in the blink explanation lesson.
Now, we are done with this.
Function and we are done with this function.
The next step is it's configuring the set up and the loop functions and this will be an easy thing to
do.
Then we'll take another look.
This called Bartletts Memrise, or let's make a quick overview of what we have done here.
We have used the ESTIE object to create the humidity and temperature sensor values, and we have sent
them to the blink up using V5 and V4, which are the virtual pens.
So now we have used analog to need to read the water liberal and most liberal sensors value.
And we have used the map function to map the range from zero to 2000 to a lower range, which is zero
to 20.
And in the most liberal sensor, we have used the map function to map these values from zero to 4000
to zero to 20.
And then we have some values using the virtual right function in the public library and we use V six
and seven as virtual pens for the blink up.
And the next lesson we will set up, we will write the code inside the setup and the functions to finish
this coding process.
Thanks for watching.
If you have any questions, please ask in the Q&A about.