1
00:00:05,000 --> 00:00:06,000
Hello friends.

2
00:00:06,000 --> 00:00:17,000
Today I will tell you how to interface a LDR module or LDR sensor using Mario.

3
00:00:18,000 --> 00:00:24,000
In this case I just use LDR to generate signal for Mario.

4
00:00:25,000 --> 00:00:29,000
I just acquire this signal using two methods.

5
00:00:30,000 --> 00:00:38,000
One is using analog signal, one is using digital signal.

6
00:00:38,000 --> 00:00:41,000
So let's go for this.

7
00:00:41,000 --> 00:00:46,000
So first case I just use Express VI.

8
00:00:46,000 --> 00:00:49,000
So over here, this is my radio.

9
00:00:50,000 --> 00:00:53,000
I just use analog input over here.

10
00:00:58,000 --> 00:01:00,000
I'm just using the Express VI.

11
00:01:06,000 --> 00:01:10,000
Or here on this module we have three pins.

12
00:01:10,000 --> 00:01:12,000
One is VCC.

13
00:01:12,000 --> 00:01:14,000
I just connect it to five volt.

14
00:01:14,000 --> 00:01:15,000
One is ground.

15
00:01:15,000 --> 00:01:18,000
I just connect it to ground and one is my input.

16
00:01:19,000 --> 00:01:22,000
I just connect it to analog input.

17
00:01:22,000 --> 00:01:22,000
Okay.

18
00:01:22,000 --> 00:01:25,000
So I just place analog input over here.

19
00:01:28,000 --> 00:01:31,000
Let's check what happened when the signal is there.

20
00:01:33,000 --> 00:01:36,000
So right now you have to select the pin.

21
00:01:36,000 --> 00:01:41,000
I just connect this to a zero analog input.

22
00:01:42,000 --> 00:01:45,000
Zero pin pin number three.

23
00:01:45,000 --> 00:01:47,000
I'll just connect it over here.

24
00:01:50,000 --> 00:01:56,000
Now you just create a indicator over here.

25
00:01:56,000 --> 00:01:58,000
I just use this meter.

26
00:01:59,000 --> 00:02:00,000
Connect this meter.

27
00:02:03,000 --> 00:02:07,000
Create a while loop over here for continuous reading.

28
00:02:08,000 --> 00:02:09,000
Create controls.

29
00:02:09,000 --> 00:02:10,000
Save the code.

30
00:02:12,000 --> 00:02:14,000
Run the code.

31
00:02:17,000 --> 00:02:21,000
It will deploy, as you see right now.

32
00:02:22,000 --> 00:02:24,000
The value is nearby zero.

33
00:02:24,000 --> 00:02:29,000
When I just put my hand over it, it is generating around five volt.

34
00:02:30,000 --> 00:02:30,000
Okay.

35
00:02:30,000 --> 00:02:34,000
So right now it is generating around five volt signal.

36
00:02:35,000 --> 00:02:43,000
So if you want to check the value, also just create its digital display over here.

37
00:02:43,000 --> 00:02:50,000
As you see, I just make it large for you so that it is visible.

38
00:02:50,000 --> 00:02:53,000
So again, save it, run it.

39
00:02:54,000 --> 00:03:01,000
Right now it is when light is there, it is generating 0.395V.

40
00:03:01,000 --> 00:03:08,000
And when I just put my hand over it, it will generate 4.85 around Volt.

41
00:03:08,000 --> 00:03:15,000
Okay, so this is how you can interface using LDR with the help of analog input.

42
00:03:15,000 --> 00:03:25,000
Now I just use digital pin in place of this, so I just close this, go to my radio.

43
00:03:26,000 --> 00:03:28,000
I need to remove this one.

44
00:03:28,000 --> 00:03:31,000
Also go to my toolbox.

45
00:03:33,000 --> 00:03:36,000
Digital input I have to select.

46
00:03:39,000 --> 00:03:46,000
In this case, when I just use digital signal, you have to just change the pin.

47
00:03:46,000 --> 00:03:55,000
Also, as you see right now, I'm just using analog pin that is zero is at 11.

48
00:03:55,000 --> 00:04:07,000
I want to just use 31 pin, let's say analog digital input output pin ten that is available at 31.

49
00:04:09,000 --> 00:04:09,000
Okay.

50
00:04:09,000 --> 00:04:12,000
So I just select Port A.

51
00:04:15,000 --> 00:04:17,000
Okay, PIN number 31 is there.

52
00:04:17,000 --> 00:04:26,000
So I just remove this red wire from here and connect this wire to 31 number pin over here.

53
00:04:26,000 --> 00:04:29,000
This is my 31 number pin available.

54
00:04:30,000 --> 00:04:39,000
I need to just put one over here Boolean, which will show me the signal.

55
00:04:41,000 --> 00:04:45,000
I just connect this save It controls.

56
00:04:46,000 --> 00:04:50,000
This is a case using express.

57
00:04:50,000 --> 00:04:58,000
Now you need to deploy the code inside this when the code is deployed.

58
00:04:58,000 --> 00:05:05,000
When I just put my hand as you see it will turn on the boolean led if you want to.

59
00:05:07,000 --> 00:05:14,000
So the output on hardware also, let's say I'm just using.

60
00:05:18,000 --> 00:05:25,000
Lead Express VI also led button I'm just using over here.

61
00:05:25,000 --> 00:05:27,000
I just need to drag it over here.

62
00:05:28,000 --> 00:05:31,000
In this case, let's say I want to.

63
00:05:33,000 --> 00:05:37,000
Put the output of this LDA on zero.

64
00:05:37,000 --> 00:05:43,000
So you need to select that particular place.

65
00:05:43,000 --> 00:05:43,000
Okay.

66
00:05:44,000 --> 00:05:54,000
Just connect this particular led with your Mario output or a digital output.

67
00:05:54,000 --> 00:05:57,000
So over here I just connect it, control you.

68
00:05:57,000 --> 00:05:58,000
It will minimize.

69
00:05:58,000 --> 00:06:05,000
So it will show me on this button also in the software, also in the hardware also.

70
00:06:05,000 --> 00:06:08,000
So let's say I want to just save it.

71
00:06:11,000 --> 00:06:13,000
Now deploy the code.

72
00:06:21,000 --> 00:06:23,000
As you see right now.

73
00:06:26,000 --> 00:06:31,000
Onboard LEDs off, as you see on software.

74
00:06:31,000 --> 00:06:39,000
It is also when I just put my hand over it, software goes high and LEDs zero also high.

75
00:06:39,000 --> 00:06:48,000
So this is how you can use your hardware to generate software and hardware

76
00:06:50,000 --> 00:06:51,000
results.

77
00:06:51,000 --> 00:06:55,000
So now in this case I am just using Express VI.

78
00:06:56,000 --> 00:07:03,000
So in my earlier video I just used low level programming for analog.

79
00:07:04,000 --> 00:07:11,000
Now I just go for the digital signals for analog, low level programming.

80
00:07:11,000 --> 00:07:14,000
So I just select over here digital input output over here.

81
00:07:15,000 --> 00:07:26,000
So first you need to open, then you need to read the signal, then you need to close.

82
00:07:27,000 --> 00:07:31,000
So over here, you need to connect all these functions.

83
00:07:35,000 --> 00:07:39,000
Create control over here.

84
00:07:39,000 --> 00:07:46,000
I need to select PIN number ten Digital input Output pin number ten.

85
00:07:46,000 --> 00:07:48,000
That is available on.

86
00:07:52,000 --> 00:07:57,000
It is not digital input output pin I need to check.

87
00:07:57,000 --> 00:08:01,000
So I just go to the over here.

88
00:08:01,000 --> 00:08:03,000
So this is the input output.

89
00:08:03,000 --> 00:08:06,000
PIN number ten is at 31 pin.

90
00:08:06,000 --> 00:08:09,000
I just connect this pin already.

91
00:08:09,000 --> 00:08:12,000
So pin number ten, I have to select over here.

92
00:08:12,000 --> 00:08:19,000
Control T now I just need to create a while loop over here.

93
00:08:19,000 --> 00:08:22,000
Create control over here to stop this.

94
00:08:23,000 --> 00:08:28,000
Just show the values I need a Led right now.

95
00:08:28,000 --> 00:08:34,000
I just use the square led in place of this connect.

96
00:08:34,000 --> 00:08:34,000
This led.

97
00:08:35,000 --> 00:08:40,000
As you see right now, it is a different type of data.

98
00:08:40,000 --> 00:08:42,000
I just connect over here.

99
00:08:42,000 --> 00:08:50,000
I need to go to index array function, connect this one over here, create a constant over here and

100
00:08:50,000 --> 00:08:55,000
connect this one to this particular control u to minimize the code.

101
00:08:55,000 --> 00:08:57,000
Save it.

102
00:09:00,000 --> 00:09:01,000
Run it.

103
00:09:01,000 --> 00:09:02,000
Deploy it.

104
00:09:03,000 --> 00:09:10,000
This is how you can go with low level programming.

105
00:09:10,000 --> 00:09:17,000
In the case of when I just put my hand, it will turn on off, on off.

106
00:09:17,000 --> 00:09:25,000
This is how you can create, generate signals or acquire signals.

107
00:09:25,000 --> 00:09:27,000
Right now I am just acquiring the signal.

108
00:09:27,000 --> 00:09:31,000
Let's say I want to generate the signal on the hardware.

109
00:09:31,000 --> 00:09:35,000
Also in the previous case also as we discussed.

110
00:09:35,000 --> 00:09:41,000
So over here I just go to again my low level programming.

111
00:09:43,000 --> 00:09:50,000
I just need to write the signal in this case, just select this over here.

112
00:09:53,000 --> 00:09:53,000
Same.

113
00:09:54,000 --> 00:09:56,000
I just need to copy this.

114
00:09:58,000 --> 00:09:59,000
Over here.

115
00:09:59,000 --> 00:10:01,000
I just need to write.

116
00:10:01,000 --> 00:10:03,000
I just copy this clause.

117
00:10:03,000 --> 00:10:06,000
Also connect this one.

118
00:10:14,000 --> 00:10:20,000
Replace these values with shift registers so that some error is not there.

119
00:10:27,000 --> 00:10:29,000
Chef starts.

120
00:10:32,000 --> 00:10:36,000
Now you need to set the channel over here.

121
00:10:36,000 --> 00:10:42,000
Let's say I want to go with a Led on board led to, let's say in this case.

122
00:10:43,000 --> 00:10:49,000
So over here it will generate the signal for me.

123
00:10:50,000 --> 00:10:56,000
Control B again, you need to set build an array over here.

124
00:10:57,000 --> 00:10:59,000
Connect this particular led.

125
00:11:00,000 --> 00:11:02,000
Give this signal to over here.

126
00:11:02,000 --> 00:11:04,000
Control u to minimize.

127
00:11:04,000 --> 00:11:05,000
Save it.

128
00:11:06,000 --> 00:11:10,000
Right now the signal is displayed on Led.

129
00:11:10,000 --> 00:11:12,000
To run it.

130
00:11:12,000 --> 00:11:13,000
Deploy it.

131
00:11:15,000 --> 00:11:19,000
So now as you see, the code is deployed.

132
00:11:27,000 --> 00:11:30,000
It is taking time.

133
00:11:30,000 --> 00:11:34,000
As you see, when I just put my hand to goes high.

134
00:11:37,000 --> 00:11:39,000
It is visible to you on board.

135
00:11:40,000 --> 00:11:43,000
Led goes high and on the software also.

136
00:11:43,000 --> 00:11:49,000
So this is how you can go for digital signal acquisition or LDR.

