Now we'll clear the line.
Turtle package in which we will be keeping all the records that are related to our robot into that package.
Okay.
So open the terminal.
But this time we are not going to open the traditional terminal.
We need to install advanced terminal.
So for that we will go to the Ubuntu store and search here.
Terminator.
This is the Terminator and from here you will be able to install.
In my case it is an already installed open the terminator and now we will have to create the package.
And will create a package using this command.
Back of them is New line turtle.
Name should be new line.
Der doe underscore intro in which we will be keeping some basic information about line turtle and hit
enter.
This will create a package.
But this is the package right here.
We will create a folder that is 32 micro process.
This directory will keep the all micro rossport.
Now we will build this.
And now we'll have to write a code for micro roles.
If we will navigate to the example of micro sport and we will open the basic subscriber.
And in the first step, we are going to control the LEDs choosing the micro Roth.
There are two alleles.
So do we have to create two topics to control them?
Well, no.
I will create just one end subscriber that will be taking the values from the user.
And if we give it a zero, it should turn off both alleles.
If we give it one, it should turn on the left.
If we give it two, it will turn on this right.
And if we give it three, it will turn on the both ladies.
Okay, this way we will be saving our memory and our computation power as well.
And while we are creating the subscriber, not the publisher, because it is Micro Spark will be receiving
the information from the user that which lady has to turn on or turn off.
Okay.
And this is the basic code of the subscriber and we are going to use the int edge because our number
will be smaller.
Martin Bigger one and the subscriber.
S underscore underscore this shouldn't be the convention for us where to message the lady's message
and the type and it and let this sink same subscription godlike.
And in here we will mention it and also mention it because we are using the end at we are not going
to use is built in and here is ignored.
We will modify this.
They're fine and they server named L and Flawless.
And in here we should mention Mint eight and the subscriber should fee LEDs underscore subscriber.
And in the executor you are seeing here run so which is representing deep sweat the number absurd.
If we are using this one subscriber, it will be one.
And if we are using two subscriber, they will be invalid.
It will modify to two.
And if there are some other threats and it will be changed according to them.
And in here our subscriber is subscriber and method is message and subscription Callback is also adding
a subscription call.
Now we'll verify it if everything is right.
Yeah, this is successfully compiled, so we have to show this topic on our terminal.
So what we will do, we have to connect the Microsoft agent.
So for that we will first connect the robot.
One thing that you will keep in mind if you are connecting robot Esp32 with PC, then the ISPs getting
power from the PC.
Then you must keep your power switch off, otherwise you may get your burn.
So this is the warning that you must take into consideration.
Okay, now we have to launch the Microsoft agent.
Well with the cereal and -1 to 3 we are using, we can see from here and tab T zero and showcase.
This can be different.
You should see it.
And this is trying to connect with the Esp32.
But if the esp32 needs a reset, just plug out your USB and plug in.
It will be reconnected.
I'm sorry, we will have to upload it to code first.
Came to you my girls off and applaud the poor.
Now, if your micro Rosenau is working, then you will not be able to upload the code.
The code is uploaded now.
We will run the micro off mode.
This is connected.
This is absolutely correct.
Now I'm going to show the magic of the Terminator again.
To split vertically.
Yes.
Pros to topic New List.
Leads.
This is the topic that we have just created.
But Ros2 topic covered this topic and the messages.
S3 and IT and the colon.
Tata.
Colon.
Sure.
Okay.
This is publishing and if I give it like two, does it turn on any already?
No, currently it is not turning on any.
So we have to mention the this pin.
So LEDs are connected.
Direct LEDs are is connected at 17 pin and write Led is connected at 16 PIN.
We have to modify the code again a little bit.
But I will mention here l underscore led and 17.
In this setup we will also mention here.
We have declared entirety.
These pins are set to the output When the code will be start by default, this pin will be high.
It is by default.
Both LEDs will be turned on.
You see logic.
So we have stored this data that is is that subscriber is receiving and to this value where this variable
value and we have used this switches on this value of T, this is zero.
It will turn both LEDs to low.
It receives one, it will just turn on the left and if it receives two, it will turn on the right.
And if it receives three, it will turn on both LEDs.
Okay, so this is the first switch state, right?
So now we can just remove this already existing Led pin from here and switch from here and from here
as well.
If we will seem to score, the corn must be saved.
In this folder.
Esp32 Makarov and this should be in line.
Turtle.
Esp32 Micro Roff okay, this is the name of this will close the micro agent and upload this code.
All right.
So by default, both LEDs are turned on.
Now we will connect to Microsoft agent.
It is connected.
And we have published two.
It has turned on three.
Two.
Right.
Led.
Right.
Led.
If we want to turn off what I will give it zero.
Both at must be turned off as you can see.
So the port alleys are turned off.
And if by keyword value one can left must be on.
Yes, the left is on if carried to.
What must be done.
Yes, you can also add an outgoing minus one, but this will publish it just once.
Thus three.
Both is on.
So our LEDs are working on micro frost.
Congratulations, buddy.