Hello and welcome.
Now let's go to our Arduino on a ball so that can't send data through the serial communication protocol
to our ISP board.
Nothing will be fancy.
Our Arduino side, we will take samples from an analog digital converter and send it over soft cereal
in order to do this.
Let's first open up Arduino.
You?
Now we will basically take sensors reading and we will send it through the soft serial communication
protocol.
Let's create a new code.
I know.
The first thing that we need to do is include the soft serial communication protocol, so include.
Soft, where serial latex.
Now, the software serial.
Will be conducted using two pens.
And let's choose pens, number two and three as an example for the receiver.
And the transness tourism rookie.
So the ex ante ex will be number two and three or pins number two and three.
And here we are not using the hardware serial.
You have to make sure that you understand the difference between software, serial and hardware serial.
Now inside the voice setup, what we need to do is initialize the serial communications, you know,
begin at a specific Mod..
Then we need to plan something to make sure that it's working.
So brand new line.
And let's right project.
Or interfacing Arduino with ESB 32.
OK.
Now, once you are done, you must start the software serial using the object that we are defined here
as a W. So as W Dot Begin.
And we have to assign a board rate.
We will use the same baud rate.
Now this serial is the one that you see when you click the serial monitor and this is the software.
So this is the hardware serial and this is the software serial.
Now let's go out and say the void loop.
We started the hardware of the software serial.
Now inside the void loop, we need to print something.
So let's try to see the trend.
New line.
And saw Detroit and.
Data to.
PSP, 32, bought.
After that, we need to lead the sensor and let's connected to a zero zero.
So ADC.
Value will equal analog fields.
And inside it, we can fly zero zero now.
After this, we need to send that to the Syrian, so Syrian.
The trend.
And inside it, we must enter that in a specific format.
So the format will usually be like this.
We have tried, OK, like this, we have to add to calibrate the seas and add slash here.
And between these two kill practices, we have to install the sensor data and sensor ID.
So to say that we have more than one sensor here, we can define an I.D. So and sensor already equals,
let's say, 50 on this policy.
One.
This is the first and so that we are adding here, this would be more reasonable.
OK.
Now inside here you have tried that at a specific format so that each speaker receive it and send it
to the web.
Now.
You have to act exactly like me.
Let's start by adding that curly parentheses after that ad slash less than to.
Text marks inside them, write the name of the variable, which is since of.
After that, a slash.
Then between these two marks add label points.
That said, this is the first line.
Now the second line will send the.
Since we're already Valeo, so we will have to paste this variable since already this will rise since
that idea that takes on the serial motor and this will send its value after that, we must add a comma.
Then we can add.
The trend.
After the coma, we need to send the ADC value that we just received so this last year.
Then after this at ADC.
Value.
OK, let's.
Again, serial.
So here you need a slash, here you need to add ADC.
Value and rather slash then between these two, you have to add double points, then you need to print
the value.
So serial the trend.
He will plant this variable, which is the value of our sensor, and we need to end this so we have
to right serial dot print.
And so that we need to better protect the seas.
As you can see, we started it with a coral plant disease and we ended it with that closing tag for
darker purposes.
Now to end this, you must interview your line, which means that you have you are done and the data
must be sent.
So at the end.
That's it.
This is the guy that we are going to send to the cereal or the hardware our.
Now we need to send the same data to the software cereal that we just created.
And to do that.
We just need to copy the very same code so we can copy all of this and based it all.
We can write it again.
But save time.
I will just copy.
Scored and based it here.
Now you have to change cereal with S.W..
It takes all accuses the very same methodology.
So we would send the very same values.
And at the end, we need to either delay, let's make it 3000 milliseconds or 4000 milliseconds.
Now let's save our code.
Let's name it, Arduino.
All.
Code click save.
Now what you need to do is simply upload this code to a Arduino owner.
So let me hook up my Arduino owner.
Now that we have the boat connected to the device manager.
And from here, you can see the port on eight.
So go to the tools, make sure that command is chosen and obviously to all then verify the code to make
sure that doesn't have any errors.
But now a blow court.
Now, all stakeholders applauded, you can open up the serial monitor.
And see for herself a kind of data that's being sent, as you can see, send that to your ISP 32 now
a census, it is one they see value is three hundred nineteen.
And that's changing now.
This data will be sent to the U.S. people through the serial or the soft cereal protocol, and we are
going to cover all of the SB 32 coding.
Now we are done with Arduino coding.
Now you can send any other value depending on your project, but this is it.
If your remote is showing, this means that the serial communications working correctly and you are
sending data in the correct format, teleprompter sees an opening and closing.
But since what idea?
Between two double quotation, they do see value between two double quotation and we have the Cinsault
I.D. value, the sensor value, and we have a comma here between them.
So if you want to send other values, you have to add a comma and add that to the very same format.
This two double points, then the value so we can send 100 value from Arduino to GSP.
Well, you can even sentence insults reading depending on the sense of I.D. and the ADC value for each
sensor.
But here we are only sending two values since we're ID and the sensor value, and this is the format
that you have to send the data.
And that's it for this lesson.
Thanks for watching.
This is Ashraf from educational engineering to you.