1
00:00:04,000 --> 00:00:05,000
Hello friends.

2
00:00:05,000 --> 00:00:15,000
Today I will tell you how to read multiple digital signals using visa or using serial connections with

3
00:00:15,000 --> 00:00:16,000
the help of LabVIEW and Arduino.

4
00:00:17,000 --> 00:00:25,000
So over here I have a Arduino code, as you already know, in the case of Serial Read, we just first

5
00:00:27,000 --> 00:00:30,000
install a code inside the Arduino.

6
00:00:30,000 --> 00:00:35,000
So in my previous video I just use for LDR only one LDR.

7
00:00:35,000 --> 00:00:38,000
In this case I just use two LDR over here.

8
00:00:39,000 --> 00:00:46,000
First, this is my first LDR, this is my second LDR and this is my output pins pin number eight and

9
00:00:46,000 --> 00:00:47,000
PIN number nine.

10
00:00:47,000 --> 00:00:49,000
I just use over here.

11
00:00:49,000 --> 00:00:54,000
So over here, as you see, LDR one is connected to PIN number eight.

12
00:00:54,000 --> 00:00:57,000
LDR two is connected to PIN number nine.

13
00:00:57,000 --> 00:01:02,000
Over here I just use two variables variable one, variable two.

14
00:01:02,000 --> 00:01:05,000
And these are my integer types.

15
00:01:05,000 --> 00:01:13,000
So over here I just use a character also that is s, and in this case I just use two values.

16
00:01:13,000 --> 00:01:15,000
I just read serially.

17
00:01:15,000 --> 00:01:23,000
So over here, in this case, the data is like a b, b, c, c, b like this.

18
00:01:24,000 --> 00:01:25,000
Two characters are there.

19
00:01:25,000 --> 00:01:29,000
Okay, so void setup Serial.begin pinmode.

20
00:01:29,000 --> 00:01:35,000
Set for LDR one input pinmode set for LDR two is again input.

21
00:01:35,000 --> 00:01:41,000
Okay, so over here I just go to the loop over here.

22
00:01:41,000 --> 00:01:49,000
Variable v r1 digital read from LDR 1VR2 digital read from LDR two.

23
00:01:50,000 --> 00:02:00,000
Over here I have the condition if var one is equal to high, so S00 stands over here.

24
00:02:00,000 --> 00:02:03,000
The indexing for character zero.

25
00:02:03,000 --> 00:02:08,000
So it is equal to a else it equal to b.

26
00:02:08,000 --> 00:02:14,000
If var one is high, in this case it will print A in this character.

27
00:02:14,000 --> 00:02:18,000
Otherwise it will print B in the war.

28
00:02:18,000 --> 00:02:29,000
Two if it is high, if the PIN number nine will read high signal, it will generate it indexing one

29
00:02:29,000 --> 00:02:37,000
or means character to C, then otherwise it will generate B and over here I just use serial print.

30
00:02:37,000 --> 00:02:41,000
Ln okay, so this is the code.

31
00:02:42,000 --> 00:02:48,000
Now I just select the board Arduino Uno board.

32
00:02:48,000 --> 00:02:50,000
It is selected Compot.

33
00:02:50,000 --> 00:02:52,000
It is selected hit on run button.

34
00:02:58,000 --> 00:03:04,000
Now the code is burned into the Arduino.

35
00:03:04,000 --> 00:03:10,000
Now, I just go to the case of LabVIEW.

36
00:03:10,000 --> 00:03:19,000
As you see in the previous case, we just use for single comparison right now, I just copy it.

37
00:03:19,000 --> 00:03:23,000
And over here, as you see, this is my string subset.

38
00:03:23,000 --> 00:03:25,000
It is connected to the main string.

39
00:03:25,000 --> 00:03:28,000
And over here, this is my sub string two.

40
00:03:28,000 --> 00:03:36,000
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

41
00:03:36,000 --> 00:03:40,000
it will turn on LDR one or LDR two.

42
00:03:40,000 --> 00:03:41,000
Okay.

43
00:03:41,000 --> 00:03:46,000
So this is how when I just hit on run button, you have to need to set your com port over here.

44
00:03:47,000 --> 00:03:48,000
I just hit on run button.

45
00:03:49,000 --> 00:03:53,000
As you see, B.B. is there because no high signal is there.

46
00:03:53,000 --> 00:04:02,000
When I just put my hand over LDR to it will generate high signal and it will buffer the data.

47
00:04:02,000 --> 00:04:12,000
And when I just go for LDR one, it will generate signal for a So this is how and when I just close

48
00:04:12,000 --> 00:04:18,000
both the right now these two will generate signal for me.

49
00:04:18,000 --> 00:04:27,000
Okay, so this is how and if you just in this case I just stop this, I just remove this delay signal

50
00:04:27,000 --> 00:04:29,000
and I just hit on run button again.

51
00:04:29,000 --> 00:04:30,000
Let's check what happened.

52
00:04:32,000 --> 00:04:37,000
As you see, same problem is there it is reading very continuously.

53
00:04:37,000 --> 00:04:43,000
So I just put over here the delay of only one second.

54
00:04:43,000 --> 00:04:47,000
Let's check one millisecond, not one second.

55
00:04:47,000 --> 00:04:49,000
It is one millisecond, as you see.

56
00:04:50,000 --> 00:04:55,000
So it will run now.

57
00:04:55,000 --> 00:04:58,000
So this is how you can read serially.

58
00:04:59,000 --> 00:05:10,000
So over here I just put five instead of one millisecond so it is stable for some seconds milliseconds.

59
00:05:10,000 --> 00:05:19,000
So this is how you can read signals using visa in serial mode.

60
00:05:20,000 --> 00:05:22,000
So this is all about today's lecture.

61
00:05:22,000 --> 00:05:23,000
Thank you.

