1
00:00:05,000 --> 00:00:06,000
Hello, friends.

2
00:00:06,000 --> 00:00:13,000
Today I will tell you how to interface three different sensors.

3
00:00:13,000 --> 00:00:14,000
Or you can say four different sensors.

4
00:00:15,000 --> 00:00:21,000
One is my touch sensor, one is my LDR, one is my.

5
00:00:25,000 --> 00:00:26,000
Air sensor.

6
00:00:26,000 --> 00:00:29,000
And also one is my button.

7
00:00:29,000 --> 00:00:37,000
So in this case, in this particular case, I just use my Rio code over here.

8
00:00:37,000 --> 00:00:42,000
This is my my Rio project I just select first.

9
00:00:43,000 --> 00:00:46,000
I'm just using different express services.

10
00:00:47,000 --> 00:00:54,000
So let's say I want to first select digital input for my air sensor.

11
00:00:55,000 --> 00:01:02,000
This air sensor is connected to my Port B In this module we have three pins.

12
00:01:02,000 --> 00:01:06,000
One is VCC, one is ground and one is signal.

13
00:01:06,000 --> 00:01:19,000
So I just connect this with my digital PIN number ten or it is pin number 31 on Port B, I just configure

14
00:01:19,000 --> 00:01:19,000
it.

15
00:01:20,000 --> 00:01:30,000
My LDR is connected to port a pin number 31 again, and my air sensor it is connected to PIN number

16
00:01:31,000 --> 00:01:34,000
zero, of course, digital pin.

17
00:01:35,000 --> 00:01:39,000
So I just again go to the my Rio.

18
00:01:40,000 --> 00:01:45,000
I just locate over here so that I just again select.

19
00:01:49,000 --> 00:01:54,000
Right now, I just show you a different type of code in this case.

20
00:01:59,000 --> 00:02:02,000
So over here I just select PIN number ten.

21
00:02:09,000 --> 00:02:22,000
Now I just need another digital pin for Port C, That is my touch sensor over here I just select.

22
00:02:23,000 --> 00:02:26,000
You can also go with low level coding.

23
00:02:26,000 --> 00:02:31,000
I already explained this in my previous videos.

24
00:02:32,000 --> 00:02:35,000
So over here, this is my digital pin number zero.

25
00:02:40,000 --> 00:02:44,000
Now all the pins are configured.

26
00:02:44,000 --> 00:02:47,000
I also select the button also over here.

27
00:02:55,000 --> 00:02:58,000
So now button is also configured.

28
00:02:58,000 --> 00:03:00,000
That is onboard button.

29
00:03:01,000 --> 00:03:06,000
It is available on Mario itself.

30
00:03:08,000 --> 00:03:16,000
So now I just go to the system over here.

31
00:03:16,000 --> 00:03:19,000
I want to select the button Boolean.

32
00:03:21,000 --> 00:03:23,000
Uh, in the classic.

33
00:03:23,000 --> 00:03:29,000
I just go over here, I just select this round led.

34
00:03:33,000 --> 00:03:35,000
I just make a copy of it.

35
00:03:39,000 --> 00:03:45,000
Four times I needed in this case because I have four signals.

36
00:03:46,000 --> 00:03:50,000
Just make it aligned properly.

37
00:03:52,000 --> 00:03:56,000
First one is, let's say my sensor.

38
00:03:56,000 --> 00:04:00,000
Second one is, let's say my sensor.

39
00:04:00,000 --> 00:04:04,000
Third one is my, let's say, touch sensor.

40
00:04:06,000 --> 00:04:09,000
And fourth one is my button.

41
00:04:12,000 --> 00:04:17,000
Okay, so now you need to connect all these one.

42
00:04:17,000 --> 00:04:28,000
So this is B, it is connected to R, This is a this is connected to my port A and this is connected

43
00:04:28,000 --> 00:04:37,000
to Port C and this button is connected to my hardware onboard button.

44
00:04:37,000 --> 00:04:41,000
Now I just go to Boolean over here.

45
00:04:41,000 --> 00:04:45,000
I need to use different gates, let's say.

46
00:04:45,000 --> 00:04:52,000
So first, in this case, I'm just using end gate if the output of i r.

47
00:04:54,000 --> 00:04:56,000
And LDR.

48
00:04:57,000 --> 00:05:02,000
Comes in this case, it will turn on the Led.

49
00:05:02,000 --> 00:05:07,000
I just go to the again, my radio toolbox over here.

50
00:05:08,000 --> 00:05:11,000
I just need to select the Led Express VI.

51
00:05:18,000 --> 00:05:23,000
So over here I just select all the four LEDs.

52
00:05:30,000 --> 00:05:42,000
When Elder One and I are both are turned on or both will get a signal, it will turn on my zero.

53
00:05:42,000 --> 00:05:43,000
Okay.

54
00:05:44,000 --> 00:05:51,000
If the condition is that if the LDR or.

55
00:05:53,000 --> 00:05:56,000
The touch sensor will generate signal.

56
00:05:56,000 --> 00:05:59,000
In that case, it will turn on the Led one.

57
00:06:00,000 --> 00:06:01,000
If.

58
00:06:04,000 --> 00:06:05,000
That sensor.

59
00:06:08,000 --> 00:06:15,000
Or button anyone gets output.

60
00:06:15,000 --> 00:06:18,000
In that case it will turn on led to.

61
00:06:19,000 --> 00:06:33,000
And last signal, if you, let's say, want to compound when all the buttons not all the only three.

62
00:06:34,000 --> 00:06:40,000
I'm just going for three, let's say your sensor.

63
00:06:42,000 --> 00:06:43,000
Touch sensor.

64
00:06:46,000 --> 00:06:52,000
And it will turn on my Led three based on this.

65
00:06:52,000 --> 00:06:55,000
So minimize it.

66
00:06:57,000 --> 00:07:00,000
Create a loop over here.

67
00:07:04,000 --> 00:07:08,000
Create a control over here to stop the button.

68
00:07:09,000 --> 00:07:10,000
Save the code.

69
00:07:17,000 --> 00:07:18,000
Run the code.

70
00:07:18,000 --> 00:07:23,000
Deploy the code and let's check what happened.

71
00:07:23,000 --> 00:07:35,000
So in the usually I just check for every sensor like air touch and the button also.

72
00:07:36,000 --> 00:07:40,000
So as you see, it will turn on my air sensor.

73
00:07:40,000 --> 00:07:43,000
So when I just put my hand over here it is.

74
00:07:46,000 --> 00:07:47,000
Differently configured.

75
00:07:47,000 --> 00:07:49,000
You just need to change.

76
00:07:50,000 --> 00:08:00,000
I just place a node gate over here because it is generating signal initially, so I just delete this.

77
00:08:01,000 --> 00:08:04,000
I just make note of this.

78
00:08:06,000 --> 00:08:11,000
So in this software part, it will run properly right now.

79
00:08:11,000 --> 00:08:12,000
Control s.

80
00:08:16,000 --> 00:08:19,000
Or you just need to change on hardware.

81
00:08:20,000 --> 00:08:25,000
Also right now, code we just deploy the code.

82
00:08:32,000 --> 00:08:36,000
As you see when I just put my hand over.

83
00:08:39,000 --> 00:08:49,000
It will turn on to LEDs because I just use exclusive or and or gate and it also turn on my HDR signal

84
00:08:49,000 --> 00:08:53,000
or the software when I just put my touch sensor.

85
00:08:54,000 --> 00:09:01,000
In this case, again, exclusive or or it will turn on.

86
00:09:02,000 --> 00:09:06,000
Now I just go to the LDR.

87
00:09:07,000 --> 00:09:16,000
When I just put my hand over here, it will turn on the and when I just put my hand on the or the LDR

88
00:09:16,000 --> 00:09:21,000
and it will turn on zero Led one.

89
00:09:21,000 --> 00:09:25,000
Now I just turn on the button.

90
00:09:27,000 --> 00:09:31,000
It will turn on to and button also.

91
00:09:31,000 --> 00:09:40,000
So this is how you can program or how you can create hardware and software in loop coding.

92
00:09:40,000 --> 00:09:43,000
So this is all about today's lecture.

93
00:09:43,000 --> 00:09:46,000
I just stop this code over here.

94
00:09:46,000 --> 00:09:47,000
Thank you.

