1
00:00:11,000 --> 00:00:12,000
Hello, friends.

2
00:00:12,000 --> 00:00:18,000
Today I will tell you how to generate analog signal using python code.

3
00:00:18,000 --> 00:00:22,000
With the help of any USB 6009 DAC card.

4
00:00:22,000 --> 00:00:27,000
For that purpose I just import an IDE library.

5
00:00:30,000 --> 00:00:33,000
And a big max library.

6
00:00:34,000 --> 00:00:36,000
After that, you have to just.

7
00:00:39,000 --> 00:00:44,000
Assign a task and a mix.

8
00:00:45,000 --> 00:00:46,000
Dot task.

9
00:00:48,000 --> 00:00:50,000
As dusk.

10
00:00:54,000 --> 00:00:55,000
Indentation.

11
00:00:56,000 --> 00:01:03,000
After this, we have to assign the port in the case of USB 6009 DAC card.

12
00:01:03,000 --> 00:01:18,000
I have only two analog output pins a0 zero and A0 one pin, so just use task dot a0 stands for analog

13
00:01:18,000 --> 00:01:18,000
output.

14
00:01:21,000 --> 00:01:21,000
Channels.

15
00:01:23,000 --> 00:01:32,000
Add underscore analog output channel and it is also a voltage.

16
00:01:37,000 --> 00:01:38,000
Underscore channel.

17
00:01:41,000 --> 00:01:44,000
Then you have to put device name.

18
00:01:46,000 --> 00:01:47,000
That is my day one.

19
00:01:50,000 --> 00:01:51,000
Then.

20
00:01:54,000 --> 00:01:59,000
You have to put analog output zero.

21
00:02:01,000 --> 00:02:04,000
Then my channel.

22
00:02:09,000 --> 00:02:09,000
Sit.

23
00:02:11,000 --> 00:02:13,000
It is my.

24
00:02:16,000 --> 00:02:17,000
Channel.

25
00:02:17,000 --> 00:02:25,000
And over here you just put the range of minimum and maximum voltage.

26
00:02:27,000 --> 00:02:28,000
That is.

27
00:02:30,000 --> 00:02:31,000
Zeal.

28
00:02:35,000 --> 00:02:36,000
This is my maximum voltage.

29
00:02:37,000 --> 00:02:41,000
Now just assign a variable that is value.

30
00:02:43,000 --> 00:02:46,000
You want to write to an output port?

31
00:02:46,000 --> 00:02:49,000
Initially I just put five.

32
00:02:51,000 --> 00:02:54,000
Then start the task.

33
00:02:57,000 --> 00:02:59,000
After this, Right.

34
00:03:00,000 --> 00:03:02,000
It's task, right?

35
00:03:08,000 --> 00:03:09,000
And inside, right?

36
00:03:09,000 --> 00:03:13,000
You just put the value because the name of the variable is value.

37
00:03:14,000 --> 00:03:15,000
Then stop the task.

38
00:03:18,000 --> 00:03:21,000
This is the called Python code.

39
00:03:22,000 --> 00:03:25,000
Just save it now.

40
00:03:25,000 --> 00:03:26,000
Run it.

41
00:03:26,000 --> 00:03:29,000
Let's check what happened to the lead.

42
00:03:29,000 --> 00:03:34,000
Right now, as you see over here, I have an output 000.

43
00:03:34,000 --> 00:03:35,000
And this is my ground.

44
00:03:35,000 --> 00:03:36,000
Yellow one is my ground.

45
00:03:37,000 --> 00:03:38,000
This is connected to.

46
00:03:38,000 --> 00:03:42,000
This is my ground and this is my positive.

47
00:03:43,000 --> 00:03:43,000
Okay.

48
00:03:43,000 --> 00:03:45,000
This brown one is my positive.

49
00:03:45,000 --> 00:03:47,000
And over here, this is my lead.

50
00:03:47,000 --> 00:03:49,000
Right now, it is in off condition.

51
00:03:49,000 --> 00:03:51,000
Let's run it.

52
00:03:51,000 --> 00:03:56,000
When I run it, as you see, it goes high.

53
00:03:56,000 --> 00:04:02,000
And again, when I put inside, this value is four.

54
00:04:02,000 --> 00:04:07,000
In this case, when it got five volt, the brightness is very high.

55
00:04:07,000 --> 00:04:17,000
When I again run it with value four volt, the brightness will be less.

56
00:04:17,000 --> 00:04:23,000
It is less right now as compared to previous one.

57
00:04:23,000 --> 00:04:27,000
And if I put 3.1V over here.

58
00:04:28,000 --> 00:04:29,000
So let's run it.

59
00:04:35,000 --> 00:04:39,000
As you see now, the brightness is decreasing.

60
00:04:39,000 --> 00:04:43,000
And when I put here, let's say 2.5.

61
00:04:44,000 --> 00:04:46,000
Save it and again, run it.

62
00:04:50,000 --> 00:04:50,000
It is.

63
00:04:52,000 --> 00:04:55,000
The brightness goes low again and when it is too cold.

64
00:04:57,000 --> 00:04:58,000
Save it.

65
00:04:59,000 --> 00:04:59,000
Run it.

66
00:05:03,000 --> 00:05:04,000
Now.

67
00:05:06,000 --> 00:05:13,000
Breakdancing is legless, and when it is one bolt, it goes below threshold value.

68
00:05:14,000 --> 00:05:16,000
Now it is off.

69
00:05:17,000 --> 00:05:22,000
So this is how you can generate analog signal using python code.

70
00:05:22,000 --> 00:05:31,000
If you want to go for continuous sample writing, you just use for loop in case of this code.

71
00:05:31,000 --> 00:05:35,000
So this is all about today's lecture, how you can.

