Hello, friends.
Today I will show you how to control onboard four LEDs using an image.
In that case, I just first control the whole four LEDs using software code.
After this I just control the Led using particular button.
Okay.
So let's first in this case, I just create a project and over here I, as you see, already project
is created in this.
I just go to the VI and over here in this particular VI, I just select my Rio toolbox over here.
I just need to select the LEDs Express VI.
In this case, it will ask me how many LEDs with how many LEDs I want to work.
Okay, so over here, as you see, I got all the four LEDs right now.
So let's first select all the four LEDs.
Right now I'm just using four LEDs.
Express VI.
Okay, As you see over here, all the four LEDs comes create buttons over here.
So led zero over here.
I just make a copy of it.
Just arrange these LEDs.
0234.
This is my one.
This is my two.
This is my three.
Okay, Now you just need to connect.
Control, you minimize it.
Just place a while loop for continuous reading.
Writing.
Not reading.
Deploy the code.
When you just run it, it will deploy the code for you.
Save it.
All the four LEDs we can control using these four buttons.
Right now, I just press 101, two, three.
In the hardware part, you can just check over here right now.
All the four LEDs are in on state right now, all the four LEDs in off state.
So this is how you can generate signals using these express VI.
Now I just create another project using button.
Also, I want to control these LEDs using particular button.
So I just go to my Mario.
Toolbox.
I just drag button.
In this case, I'm just using this button to control these four LEDs.
In the first case, I just connect all the LEDs with this particular button.
When I just press this button, all the four LEDs will turn on.
Otherwise it will turn off.
Just remove this control.
B So in this case, I'm generating signal.
Using this particular onboard button.
So now just save it.
Deploy it.
In this case, there is no control in the software part.
The control is only to stop the code.
Okay.
So right now, when I just press this particular button, all the four LEDs turn on.
As you see.
So it is up to me how to control this on board led right now.
Right now I just make another code for you.
Let's say in this place I'm just using negate function also.
For.
First one and third one.
No multiple negates required.
So I just connect over here and this one is my connected to this one.
And over here.
Now I just save it, Run it.
It is deploying the code.
Initially, two LEDs are turned on and two are in off state.
According to the code.
As you see, when I just press my button, these two goes off.
Another two goes on, as you see.
So you can make a running code using this also.
Okay, so this is how you can build.
Now I just go with another code.
I just stop this code.
In this particular case, I just show you another case.
Also, right now, I just remove this particular part from or connection from the Mario.
Right now Mario is powered.
I just it just contain the program.
Also, as you see right now, when I just connect it again, I need to configure this as you see on
the software part, connection to the target has been lost.
I need to configure this again.
As you see right now, it is configuring just close this one, minimize this.
Let's check it is present over here or not refresh it or need to connect.
Let's check.
It is connecting.
So this is how you can apply.
This is how you can control your Mario using express code.
As you see, it is now initializing.
Right now it is green.
It is connected.
Let's just create another code.
I'm not using this button over here in place of this control Z.
Control B, I'm just creating a code running light led code.
So I just create shift registers over here.
Initially, let's say these shift registers are false condition.
Otherwise it will generate true condition.
True False.
True.
False condition.
It will generate and just also place some delay over here.
I just want to create a 500 millisecond delay.
So one, initially it is turned on and three also and two off and four also off.
Okay, So this is the code.
And let's just use the button to control the loop.
Again, go to the Mario button.
Press.
Okay.
In place of this button, I want to control this loop using this particular button.
Just connect it.
Save it.
Control s, run it.
Let's check what happened.
The code is deployed.
As you see it, is running.
Lights are running on and off, on and off.
If you want to just make the speed faster, first, you need to stop the code.
I'm just stopping it from here only.
As you see now, I just want to make it 100 milliseconds again.
I want to deploy the code.
In this case, the LEDs are running more faster as compared to the previous one.
Right now it is 100 milliseconds.
Previously it is 500 milliseconds.
DeLay is there, as you see.
So this is how you can build your own code using Express VI in case of Mario.
Thank you.