1
00:00:05,000 --> 00:00:05,000
Hello friends.

2
00:00:05,000 --> 00:00:14,000
Today I will tell you how to generate multiple digital signals using Python with the help of Arduino.

3
00:00:14,000 --> 00:00:18,000
So first you have to install.

4
00:00:20,000 --> 00:00:21,000
This.

5
00:00:22,000 --> 00:00:22,000
Okay.

6
00:00:23,000 --> 00:00:28,000
Or you can say Arduino library for Python.

7
00:00:31,000 --> 00:00:34,000
It will open in Arduino IDE over here.

8
00:00:34,000 --> 00:00:36,000
You just set your board.

9
00:00:37,000 --> 00:00:39,000
In my case, Arduino Uno is there.

10
00:00:40,000 --> 00:00:44,000
You have to just set com port on it.

11
00:00:48,000 --> 00:00:51,000
When it is uploaded.

12
00:00:51,000 --> 00:00:59,000
You are already know is communicating with your python language.

13
00:01:02,000 --> 00:01:10,000
So I guess taking some time every time when you want to communicate with Arduino, with the help of

14
00:01:10,000 --> 00:01:13,000
Python, you just install this library.

15
00:01:16,000 --> 00:01:18,000
So it is done.

16
00:01:19,000 --> 00:01:21,000
Basically it is it interfacing fine.

17
00:01:21,000 --> 00:01:26,000
So just go to IDL over here.

18
00:01:29,000 --> 00:01:34,000
In the case of ideally you just open a new script.

19
00:01:38,000 --> 00:01:43,000
So before writing the code, I just go to the hardware part.

20
00:01:44,000 --> 00:01:50,000
In this case, I just want to generate four digital, three digital signals.

21
00:01:51,000 --> 00:01:54,000
So I just connect ground.

22
00:01:54,000 --> 00:02:04,000
Then I just connect PIN number 11, nine and seven.

23
00:02:04,000 --> 00:02:09,000
Okay, so this one is my ground pin.

24
00:02:10,000 --> 00:02:12,000
I just connect it over here.

25
00:02:13,000 --> 00:02:18,000
This is my ground pin and I just connect the Led.

26
00:02:18,000 --> 00:02:24,000
So over here, this is my Led ground.

27
00:02:25,000 --> 00:02:29,000
I'm just sharing the ground with all the LEDs.

28
00:02:30,000 --> 00:02:35,000
So over here, this is my ground and posted pin.

29
00:02:36,000 --> 00:02:39,000
And this is my third pin led.

30
00:02:41,000 --> 00:02:47,000
So the purple one is connected to PIN number 11.

31
00:02:48,000 --> 00:02:58,000
The black blue one is connected to the PIN number nine and it is connected to yellow led.

32
00:02:59,000 --> 00:03:04,000
And this is my seventh pin that is connected to the green one.

33
00:03:05,000 --> 00:03:08,000
So over here, you can check.

34
00:03:10,000 --> 00:03:15,000
So now we just go to the code over here.

35
00:03:15,000 --> 00:03:18,000
You just call the library from.

36
00:03:21,000 --> 00:03:21,000
Already know.

37
00:03:26,000 --> 00:03:27,000
Import.

38
00:03:29,000 --> 00:03:29,000
Hardy.

39
00:03:35,000 --> 00:03:36,000
Import.

40
00:03:38,000 --> 00:03:40,000
I do know this.

41
00:03:41,000 --> 00:03:43,000
You just set the board.

42
00:03:47,000 --> 00:03:48,000
Bowler is playing to.

43
00:03:52,000 --> 00:03:53,000
Already know.

44
00:03:55,000 --> 00:03:55,000
We're here.

45
00:03:55,000 --> 00:04:03,000
You set the baud rate that is 9600 and also set the port.

46
00:04:06,000 --> 00:04:08,000
Or if my come it.

47
00:04:11,000 --> 00:04:11,000
Cool.

48
00:04:12,000 --> 00:04:12,000
Cool.

49
00:04:13,000 --> 00:04:18,000
Now, after this, you just set the mode in mode.

50
00:04:18,000 --> 00:04:22,000
In this case, I just use three pins.

51
00:04:22,000 --> 00:04:26,000
So board dot pin mode.

52
00:04:31,000 --> 00:04:31,000
In.

53
00:04:32,000 --> 00:04:35,000
And over here, you just set up the PIN number.

54
00:04:35,000 --> 00:04:38,000
In this case, I'm just using 11th pin.

55
00:04:38,000 --> 00:04:41,000
Ninth pin and seventh pin.

56
00:04:42,000 --> 00:04:43,000
So 11.

57
00:04:44,000 --> 00:04:49,000
The mode is output because I'm just generating.

58
00:04:52,000 --> 00:04:53,000
After this.

59
00:04:54,000 --> 00:04:55,000
Just copy this command.

60
00:04:58,000 --> 00:05:02,000
Multiple times because in this case I'm just generating three signals.

61
00:05:02,000 --> 00:05:05,000
So just copy it three times.

62
00:05:07,000 --> 00:05:07,000
Over here.

63
00:05:08,000 --> 00:05:09,000
The pin number is.

64
00:05:11,000 --> 00:05:15,000
Nine and the number is seven.

65
00:05:15,000 --> 00:05:18,000
So all the three pins are assigned.

66
00:05:18,000 --> 00:05:24,000
Now you have to just generate the signal for this.

67
00:05:24,000 --> 00:05:30,000
So over here, gold dot digital, right?

68
00:05:32,000 --> 00:05:32,000
Digital.

69
00:05:34,000 --> 00:05:41,000
Right now you have to just assign the value.

70
00:05:41,000 --> 00:05:45,000
So PIN number 11 will get high signal.

71
00:05:48,000 --> 00:05:53,000
I just generate high signal through all the pins.

72
00:05:53,000 --> 00:05:55,000
After that, I just change the signal.

73
00:05:56,000 --> 00:05:58,000
So again, copy it.

74
00:05:59,000 --> 00:06:05,000
So pin number nine is there and seven is there.

75
00:06:05,000 --> 00:06:07,000
So the mode is output mode.

76
00:06:08,000 --> 00:06:09,000
Just save it.

77
00:06:11,000 --> 00:06:13,000
I just save it to my previous folder.

78
00:06:15,000 --> 00:06:16,000
In the code.

79
00:06:18,000 --> 00:06:21,000
I will share with you this code also.

80
00:06:21,000 --> 00:06:23,000
So code is saved.

81
00:06:23,000 --> 00:06:25,000
Now you have to run it.

82
00:06:25,000 --> 00:06:28,000
When you run it, all the three Led will glow.

83
00:06:34,000 --> 00:06:39,000
So in this case, as you see.

84
00:06:43,000 --> 00:06:45,000
Connections are loose.

85
00:06:46,000 --> 00:06:54,000
So as you see, both the all the LEDs are on or in the high state.

86
00:06:54,000 --> 00:07:03,000
If you want to change the state, let's say I want to just change the state of middle one that is connected

87
00:07:03,000 --> 00:07:04,000
to the PIN nine.

88
00:07:04,000 --> 00:07:06,000
I just put low signal over here.

89
00:07:08,000 --> 00:07:14,000
Save it and when you again run it, let's check the output.

90
00:07:14,000 --> 00:07:16,000
Only two LEDs will glow.

91
00:07:16,000 --> 00:07:20,000
Middle one is in the state of low.

92
00:07:20,000 --> 00:07:24,000
So now you just generate a signal 101.

93
00:07:24,000 --> 00:07:34,000
If you want to generate using these three LEDs, you can generate from zero zero 0 to 1 one one.

94
00:07:35,000 --> 00:07:44,000
Okay, so this is how you can generate multiple digital signals with the help of Python using Arduino.

