Hello friends.
Today I will tell you how to read multiple digital signals using visa or using serial connections with
the help of LabVIEW and Arduino.
So over here I have a Arduino code, as you already know, in the case of Serial Read, we just first
install a code inside the Arduino.
So in my previous video I just use for LDR only one LDR.
In this case I just use two LDR over here.
First, this is my first LDR, this is my second LDR and this is my output pins pin number eight and
PIN number nine.
I just use over here.
So over here, as you see, LDR one is connected to PIN number eight.
LDR two is connected to PIN number nine.
Over here I just use two variables variable one, variable two.
And these are my integer types.
So over here I just use a character also that is s, and in this case I just use two values.
I just read serially.
So over here, in this case, the data is like a b, b, c, c, b like this.
Two characters are there.
Okay, so void setup Serial.begin pinmode.
Set for LDR one input pinmode set for LDR two is again input.
Okay, so over here I just go to the loop over here.
Variable v r1 digital read from LDR 1VR2 digital read from LDR two.
Over here I have the condition if var one is equal to high, so S00 stands over here.
The indexing for character zero.
So it is equal to a else it equal to b.
If var one is high, in this case it will print A in this character.
Otherwise it will print B in the war.
Two if it is high, if the PIN number nine will read high signal, it will generate it indexing one
or means character to C, then otherwise it will generate B and over here I just use serial print.
Ln okay, so this is the code.
Now I just select the board Arduino Uno board.
It is selected Compot.
It is selected hit on run button.
Now the code is burned into the Arduino.
Now, I just go to the case of LabVIEW.
As you see in the previous case, we just use for single comparison right now, I just copy it.
And over here, as you see, this is my string subset.
It is connected to the main string.
And over here, this is my sub string two.
And it is when it is equal to C, in this case it will turn on the Led two and when it is equal to a
it will turn on LDR one or LDR two.
Okay.
So this is how when I just hit on run button, you have to need to set your com port over here.
I just hit on run button.
As you see, B.B. is there because no high signal is there.
When I just put my hand over LDR to it will generate high signal and it will buffer the data.
And when I just go for LDR one, it will generate signal for a So this is how and when I just close
both the right now these two will generate signal for me.
Okay, so this is how and if you just in this case I just stop this, I just remove this delay signal
and I just hit on run button again.
Let's check what happened.
As you see, same problem is there it is reading very continuously.
So I just put over here the delay of only one second.
Let's check one millisecond, not one second.
It is one millisecond, as you see.
So it will run now.
So this is how you can read serially.
So over here I just put five instead of one millisecond so it is stable for some seconds milliseconds.
So this is how you can read signals using visa in serial mode.
So this is all about today's lecture.
Thank you.