Hello and welcome the stimulus one in which we are going to start coding using Arduino Edesia.
We know only the.
Now.
Now, we will start by including some libraries.
First, we know for sure that we will need let me increase the font size.
We will need the wi fi library.
So right.
WI fi detects and we also need the Wi-Fi client library.
The takes and we will need that DHT censored library, so we have to include it.
And we need to blink, yes, be 30 to library, so let's include that to.
Planked.
Symbol E.S.P, 32 not.
Now, these are the main levers that we need.
Let's define some variables, and if we need more labels, we will add them as we go.
And according now define the Ich bin.
And define the the edge.
The type, so let's define again.
The edge type, a sense of type.
Now the sensor tab is DHT 11 and the PIN, as we already mentioned in the text document, that that
the expen is number twenty three.
So here we are, 23.
Now we need to initialize some variables for the really.
And other components that we have in the system now, we know for sure that Verilli is connected to
a PIN number 22.
And we also know.
That that water.
The level is connected to Ben.
No.
He is 21.
And we will define our variable for the soil sensor, and it's connected to a pin number 19.
Now, just right senseor here and right since we're here to make sure that.
Now, let's define two new variables what an ultra liberal.
And the other one, all the soil since or.
Live in that.
Now we will use that DHT library, but let's first save our code.
Now that we have saved the code, let's verify and make sure that we don't have any errors, we will
most likely face a library or as you can see now that the library is not recognized.
So you need to go to the tools.
OK, now include library and from scratch include library managed libraries.
And we need to include these libraries now.
Look for the first library.
The DHT.
Library, as you can see here, we have the city center library click install.
Install all.
Now, as you can see, the cameras installed.
Click close, click verify, now you can see that the DHT is recognized.
Now we have this library playing symbol E.S.P and go sketch include library managed libraries and do
the same thing to include this library.
Now, based here, hit the intel button.
And wait.
Now, you might need to change the key word that you are using to look for the library here we have
the blank library and the support for E.S.P 32.
And click on.
Now, as you can see, and it's told.
Now click close and try to verify to see if this works or not.
As you can see, Blinkx Simbel Library is still undefined.
So we need to do this now.
The problem that we have here is that E.S.P is written in capital letters.
Let's try small lotter and let's verify.
OK, now, as you can see.
This code now recognizes the public library, but since we are choosing, arguing on our own board,
we are facing a very fine error.
So go and change this to E.S.P 32.
Kay.
Well, let's look for the one that we have.
Yes, be difficult like this one, do it.
Yes, be 32, difficult veteran one five, could you see?
That you don't have any errors.
And make sure that you have S&P and small letters here.
It's taking some time and we have explained how to enable yes, we have to do when you are doing Idy,
you need to check this out if you can.
As you can see now, Duncan Barling, which means that all the rebels are defined and everything's working
just fine.
Now we need to make sure, OK, here we have an issue now.
We need to make sure that we create a new object from the Apache sensor, and it's called DHT.
And it will take two variables that the first one is this one, DSG Ben, and the second one is that
type.
Now.
We need to at a time of.
Let's.
Create a new playing Time Out for the blink.
We will explain why we are doing this later.
Doublecheck before moving on, we need to know that for blink up to recognize our E.S.P world, we need
to have an authentication key which will be provided by the blink up once we see the top and the coming
lessons.
So for now, we need to define a character for the authentication.
And here you need to enter.
Your syndication.
Court.
Now.
Since our E.S.P board is using Wi-Fi to connect to the Internet, we need to make sure that we have
the Wi-Fi setting set up correctly.
So define a new character for the network name.
And here we will add Wi-Fi.
This aside, and another character for the password.
It wi fi password.
You need to see column at the end of these two lines.
Now we need to create a new method to send our census data to the up.
Now, we know for sure that we have like three or four Sonsoles that are called for.
This is pretty straightforward.
We will use that DHT since our library to get the temperature and humidity readings and the water and
soil moisture levels are just analog reading.
So we can use the analog function to read the incoming data and arrange to convert it and send it to
our app.
Depending on your environment and sensor or constrains the analog values from the water and soil moisture
level sensors can be treated and mapped into orange.
Now we will create two functions to send data to.
The blink of the first function will help send the temperature and humidity values since we are relying
on the DH library and the second method will send the water and soil moisture levels, sensors, readings,
which are basically analog readings.
It will send these readings to weblink up.
So let's get started with the first function like void.
Cynde.
Senseor DH.
Now.
This is the first method, and let's define the second method, then we can start writing the code,
send salt water, soil.
OK, now we have these two methods and the next lesson we are going to call these two methods and proceed
with volume and voice at Wohlstetter functions, but that's it for this lesson.
Let's do a quick revision.
We included the Wi-Fi and Wi-Fi class libraries for the Wi-Fi connection that the city library for that
temperature and humidity sensor, the Blink Symbol E.S.P library, so that we can easily connect our
E.S.P 30 to board with the Blink servers.
We defined these to make sure that we have the correct PIN number for that d.h sensorially water and
soil sensor.
And we created two variables to store the incoming data from the water and soil sensor.
Since they are analog readings, we also defined an object called DHT from the DHT library and we created
a timer using the Blink Time Library and the Blink Symbol E.S.P 32 library and we will use it at our
functions.
Now, we already mentioned that doubling up has an authentication key for each user and for each other.
So you need to install the authentication key here and we will explain how to get it.
And the practical lesson regarding the UpLink AB, we already mentioned that we are using Wi-Fi connection.
So we define two variables.
One, for the Wi-Fi network name and the other one for the password.
Now we have two functions.
The first one will be coded to send the temperature and humidity sensor readings and the second one
will be coded to send the water and soil moisture level readings.
That's it for this lesson.
Thanks for watching.
If you have any questions, please ask in the Q&A about this is Asharaf from educational engineering
team.