Hello friends.
Today I show you potentiometer interfacing using Milo.
In this particular case, I just show you two methods.
One is using express, another one is using low level programming.
For that purpose, as you see over here, this is my my reel.
I just connect.
This is my potentiometer.
That is, I connected this one over the zero PCB.
This is my positive wire.
This is my plus five volt that is available on one pin of analog port A This is my ground and yellow
one is my signal.
That is I zero.
I am just using.
So first I just go to my two analog input.
I just selected.
Right now I am just selecting the express case.
I just show you both the cases using express and using low level coding.
Okay, so over here you just need to configure your port.
As you see, I zero.
It is connected to PIN number three.
I already connect this one.
Just select.
Okay.
So it will give you the data that is available over the particular PIN.
Number three.
Now I just go to my front panel.
In this front panel, I just use this classic numeric classic meter.
Okay?
So the range right now, I just connected maximum voltage is five, so I just change it to five, as
you see over here.
Okay, so now you just need to connect this pin to this meter.
Create a while loop for continuous reading this analog signal.
Save it.
Run it.
Or you can say deploy the code to the milieu.
As you see when I just move the Viper.
Right now, voltage is zero.
As you see, one volt.
Two volt.
If the connections are loose in that case, it will fluctuate.
Okay, so right now it is four volt and it is maximum.
So this is how you can acquire analog signal or you can acquire potentiometer output using myrio.
This is the first case.
Now I just show you the second case.
So I just stop this, delete this express VI In place of this express VI, we just go for low level
coding.
So select Mario, low level, locate analog input.
You need to first open the task.
I just put over here, minimize it a little bit.
In this case, I want to read the signal.
It is my analog read.
As you see, sine wave is over here.
Now you just need to close the task.
I also add one error handler, simple error handler.
It will automatically handle the errors.
Create constant over here.
Select the pin.
A analog input stands for analog input.
Connect this meter over here.
As you see, it is not connected because the output is an array and I am just connecting it with a scalar
value.
So you need to go to index array function in this index array function.
I just connect this over here.
Select the pin in indexing.
It is available at zero indexing.
I just save this code.
Now I just again run this code.
As you see it, is reading the signal using low level coding.
It is increasing now.
It is decreasing.
So this is up to you how to code.
In the case of low level coding, there is chances of error is very less.
But when you just use the express because this express is created by someone, some person, in that
case you may get some error.
So right now I just connect this five volt signal to 15 volt signal.
In the case of an I.D. card, the maximum voltage you can read up to ten volt, that is in the case
of educational boards.
Okay.
It is configured by the.
So right now, I just stop it in place of this.
I just connect over here as you see.
Plus five volt is available.
I just remove this Jack and connect this.
Spin two over here.
This is my plus 15 volt signal.
Is there?
Okay, so now let's check what is the value?
So again, I just I need to set it to 15.
Let's say it is reading 15 volt or not.
So run it.
Save it.
Earlier.
As you see right now, it is five volt.
I just move it to maximum.
It is zero.
In this case, it is maximum five volt.
Okay, so let's check what happened to it.
Stop it again.
I'm just checking the internal configuration.
So over here, this is the code of an analog voltage.
In this case, you just read maximum five voltage.
Okay.
So we conclude over here that the maximum voltage we can read using this card is five voltage.
Right now I just connect it to 15 volt plus 15 volt, but it is reading only five volt maximum.
Okay.
So this is how you can read analog signal using any Mario.
So this is all about today's lecture.
Thank you.