1
00:00:11,000 --> 00:00:12,000
Hello, friends.

2
00:00:12,000 --> 00:00:22,000
Today I will tell you how to generate signals using an eye tracker.

3
00:00:22,000 --> 00:00:29,000
Basically, in this case I am just using a blink led code.

4
00:00:29,000 --> 00:00:33,000
I just write blink Led code in the python.

5
00:00:33,000 --> 00:00:42,000
And using this code we have to write these signals because in the case of Blink Led, we have both the

6
00:00:42,000 --> 00:00:42,000
signals.

7
00:00:42,000 --> 00:00:44,000
That is true and false.

8
00:00:44,000 --> 00:00:51,000
In this case I just use loop and this is also an example of for loop.

9
00:00:51,000 --> 00:00:58,000
So for that purpose I just import and I type max.

10
00:01:02,000 --> 00:01:06,000
Then this is the library.

11
00:01:06,000 --> 00:01:11,000
And after this, I just use time.

12
00:01:12,000 --> 00:01:21,000
I just want to import time because I want to just place after how much time it will generate to and

13
00:01:21,000 --> 00:01:24,000
how much time after how much time it will generate force.

14
00:01:24,000 --> 00:01:26,000
So I just import

15
00:01:29,000 --> 00:01:32,000
time library from Python.

16
00:01:33,000 --> 00:01:35,000
The syntax is import time.

17
00:01:36,000 --> 00:01:43,000
After this I just start the task or just assign a variable task in this.

18
00:01:44,000 --> 00:01:45,000
Task.

19
00:01:47,000 --> 00:01:48,000
It is an I.

20
00:01:49,000 --> 00:01:51,000
I just call the library.

21
00:01:58,000 --> 00:02:06,000
Then you have to just assign the pen and it's operation.

22
00:02:06,000 --> 00:02:08,000
So it is task.

23
00:02:10,000 --> 00:02:14,000
It is digital output pin because I want to generate digital signal.

24
00:02:16,000 --> 00:02:17,000
Channels.

25
00:02:23,000 --> 00:02:24,000
Add channel.

26
00:02:28,000 --> 00:02:29,000
The Excel output

27
00:02:32,000 --> 00:02:32,000
channel.

28
00:02:33,000 --> 00:02:39,000
And inside this you have to just put the device name.

29
00:02:40,000 --> 00:02:42,000
My device name is Dave one.

30
00:02:43,000 --> 00:02:46,000
Then you have to just put port zero.

31
00:02:47,000 --> 00:02:56,000
I'm using and the line zero, as you see on the hardware part over here, this is my port zero line

32
00:02:56,000 --> 00:02:57,000
zero pin.

33
00:02:57,000 --> 00:02:58,000
This is my ground.

34
00:02:58,000 --> 00:03:06,000
I just connect port zero pin to the positive pin of led and ground pin to the negative of Led.

35
00:03:07,000 --> 00:03:11,000
After this, you have to just start the task.

36
00:03:13,000 --> 00:03:16,000
Does not start.

37
00:03:18,000 --> 00:03:23,000
Well, then you have to assign an initial value.

38
00:03:24,000 --> 00:03:28,000
And my value variable is value.

39
00:03:28,000 --> 00:03:32,000
I just put true inside it.

40
00:03:34,000 --> 00:03:45,000
Initially, the initial value is true, and I just also put a variable that is n for how much time or

41
00:03:45,000 --> 00:03:50,000
how many signals my for loop generate in this case.

42
00:03:50,000 --> 00:03:52,000
So I just put in this case only ten.

43
00:03:54,000 --> 00:04:02,000
So my blink time, I just also put a variable blinking time.

44
00:04:04,000 --> 00:04:05,000
Blink time.

45
00:04:06,000 --> 00:04:08,000
You can use any variable name.

46
00:04:09,000 --> 00:04:10,000
I'm just using blink time.

47
00:04:11,000 --> 00:04:14,000
So it is let's say one.

48
00:04:14,000 --> 00:04:15,000
It is in seconds.

49
00:04:15,000 --> 00:04:16,000
Okay.

50
00:04:16,000 --> 00:04:19,000
So in the place of one, let's say it is two seconds.

51
00:04:19,000 --> 00:04:24,000
Okay, so now you have to just write loop.

52
00:04:24,000 --> 00:04:31,000
So my syntax for for loop is for variable K in range.

53
00:04:37,000 --> 00:04:38,000
Off.

54
00:04:38,000 --> 00:04:41,000
And this is my loop.

55
00:04:43,000 --> 00:04:49,000
An indentation or Here, you have to just write task.

56
00:04:53,000 --> 00:04:58,000
And and say this just put the variable that is the value.

57
00:05:02,000 --> 00:05:10,000
Then you have to just put how much time it will sleep for, how much time it will sleep.

58
00:05:10,000 --> 00:05:13,000
So syntax is time to sleep.

59
00:05:18,000 --> 00:05:24,000
And over here you just put that time variable that is blink.

60
00:05:25,000 --> 00:05:27,000
Blink time.

61
00:05:29,000 --> 00:05:32,000
After this, you have to just put the value

62
00:05:34,000 --> 00:05:38,000
because I want to change the value after this particular time.

63
00:05:39,000 --> 00:05:41,000
Negate this.

64
00:05:41,000 --> 00:05:44,000
It is not value.

65
00:05:47,000 --> 00:05:48,000
I'm using the syntax.

66
00:05:48,000 --> 00:05:51,000
You can also put some first in the case.

67
00:05:51,000 --> 00:05:54,000
Let's say you just write true.

68
00:05:54,000 --> 00:05:55,000
After that, write false.

69
00:05:56,000 --> 00:05:57,000
You can use this also.

70
00:05:59,000 --> 00:06:05,000
I want to just check the value written by the code to the hardware part.

71
00:06:05,000 --> 00:06:14,000
I want to check these value on the software part also so that that purpose I just use print command.

72
00:06:14,000 --> 00:06:23,000
And inside this I just put value variable because this value variable will generate signals for my deck

73
00:06:23,000 --> 00:06:25,000
card and for my software part also.

74
00:06:27,000 --> 00:06:29,000
Then you have to just stop the task.

75
00:06:37,000 --> 00:06:38,000
And close the task.

76
00:06:44,000 --> 00:06:47,000
So this is the code.

77
00:06:48,000 --> 00:06:48,000
The.

78
00:06:48,000 --> 00:06:49,000
Save it.

79
00:06:50,000 --> 00:06:52,000
Let's run it.

80
00:06:58,000 --> 00:07:01,000
As you see right now, it is writing false.

81
00:07:01,000 --> 00:07:01,000
True.

82
00:07:02,000 --> 00:07:02,000
False.

83
00:07:03,000 --> 00:07:04,000
True.

84
00:07:05,000 --> 00:07:05,000
False.

85
00:07:07,000 --> 00:07:07,000
Through.

86
00:07:09,000 --> 00:07:17,000
Close to it will write only ten times because initially I assign these values.

87
00:07:17,000 --> 00:07:22,000
If you want to write for multiple times, in that case, you just go to the code

88
00:07:25,000 --> 00:07:29,000
over here, change the value.

89
00:07:29,000 --> 00:07:34,000
Let's say you want to write only five times and blink time.

90
00:07:34,000 --> 00:07:38,000
You want to change, let it is three seconds.

91
00:07:38,000 --> 00:07:41,000
Just save it and run it.

92
00:07:45,000 --> 00:07:48,000
Now, it will generate only five value in the previous case.

93
00:07:48,000 --> 00:07:51,000
It will generate ten values.

94
00:07:51,000 --> 00:07:52,000
You can check.

95
00:07:52,000 --> 00:07:55,000
It will generate only five values.

96
00:07:58,000 --> 00:08:08,000
If you want to work with this for a long time, you just put the time inside this and the values inside

97
00:08:08,000 --> 00:08:09,000
this.

98
00:08:09,000 --> 00:08:11,000
So as you see, it will generate false.

99
00:08:11,000 --> 00:08:11,000
True.

100
00:08:11,000 --> 00:08:12,000
False.

101
00:08:12,000 --> 00:08:12,000
True.

102
00:08:12,000 --> 00:08:13,000
False.

103
00:08:13,000 --> 00:08:14,000
Only five signals.

104
00:08:14,000 --> 00:08:26,000
This is how you can use blink program to generate or to blink Led or you can say how to use for loop

105
00:08:27,000 --> 00:08:31,000
inside the python for hardware purpose.

106
00:08:31,000 --> 00:08:33,000
So it is also an example of for loop.

107
00:08:34,000 --> 00:08:36,000
This is all about today's lecture.

108
00:08:36,000 --> 00:08:37,000
Thank you.

