WEBVTT 00:00.420 --> 00:09.340 Hollway creator B.-W object of BW object is created by saying GPI all dot beat up. 00:09.780 --> 00:19.170 I'm going to use the P.W. clause to create an object DWM class in the art quite cheaply IO library which 00:19.210 --> 00:25.320 I'm commonly chauffeuring is GPI so cheaply I got the beat up Wium class I'm going to use the glass 00:25.800 --> 00:30.750 and I'm going to pass these parameters to the in it method. 00:30.870 --> 00:31.250 Right. 00:31.260 --> 00:37.590 I'm going to pass these parameters to paramita that requires are the pin number for the bit of them 00:37.590 --> 00:46.590 that you're using that has been number 19 and the frequency that you are going to maintain for the entire 00:47.300 --> 00:49.020 P.W. object. 00:49.170 --> 00:54.520 So let's say I want to maintain a frequency of let me say Hausen thousand words. 00:54.540 --> 00:55.070 All right. 00:55.080 --> 00:57.640 That's the frequency that I want to maintain. 00:57.720 --> 01:04.630 OK so it's mid frequency range not a very high frequency nor a very low frequency. 01:04.890 --> 01:07.110 OK so it's a frequency. 01:07.140 --> 01:11.880 All right so I'm going to create an object so if I have to create an object which means I need to say 01:12.090 --> 01:17.280 I need to store it in a variable or stored in an object that can speed up the underscore. 01:17.550 --> 01:20.350 So I created it using the BWF class. 01:20.460 --> 01:29.010 I passed these and I passed these parameters which went to the in a method of the P.W. class and to 01:29.010 --> 01:36.570 return an object that created an object for you which of which can be you know you can use this object 01:36.670 --> 01:37.300 to. 01:37.320 --> 01:44.040 You can use now these object to access the methods of the freed up the class in order to do whatever 01:44.040 --> 01:45.120 you want to do. 01:45.120 --> 01:46.450 So let's say for example. 01:46.450 --> 01:54.340 So my 19 plan is now going to be defined as OPW and pin or it's going to be used as a beat up. 01:54.450 --> 02:02.070 In my program which means I need to see all right PIN number 19 you are up and you are GPI open form. 02:02.100 --> 02:06.000 You are the GPI open or you are the chosen one for my program. 02:06.000 --> 02:12.750 Now I want you there now when you start up what should be the voltage set you are going to give at the 02:12.750 --> 02:21.970 start that I need to say is I need to say DWM DWM underscore RBJ and you say Doc start to use this method 02:22.650 --> 02:27.160 have uses method start which is which is there in the PWO class. 02:27.210 --> 02:31.240 I need to use this method start and say OK boss. 02:31.560 --> 02:38.130 Please start at the voltage of let's say zero or this is more. 02:38.130 --> 02:39.710 This is not a voltage actually. 02:39.720 --> 02:41.440 This is called as duty cycle. 02:41.490 --> 02:50.670 So what did you decide whose duty cycle duty cycle is equal to on time divided by total time on time 02:50.670 --> 02:52.580 divided by total time. 02:52.590 --> 02:55.040 So what is on time and what is total time. 02:55.070 --> 03:04.830 OK so let's say for example I told you if if your switch you switch it on for you know switch it on 03:04.830 --> 03:09.750 for a long time then you switch it off. 03:09.750 --> 03:15.960 That means the water will be a very it will be closer to the maximum then close to the minimum. 03:15.960 --> 03:22.310 But if your off time is more then you could be closer to the minimum than to the max. 03:22.440 --> 03:23.460 Right. 03:23.460 --> 03:28.190 So we have a part of the cycle where you recycle is on time. 03:28.200 --> 03:35.310 You had by total time where if you switch it on for one fourth of the time let's say if it is on for 03:35.340 --> 03:38.070 1 divided by the total time is four. 03:38.070 --> 03:40.980 So that means time is going to be how much. 03:41.340 --> 03:47.950 If this is one and total time is four then off is going to be for the ride. 03:47.970 --> 03:49.930 So that means one by four. 03:50.130 --> 03:54.240 What would be the voltage or would it be that you recycle recycle well with the word this which comes 03:54.240 --> 04:01.100 out it is going to be just it is just going to be 25 percent which right now is going to be 25 percent. 04:01.170 --> 04:01.710 Right. 04:01.950 --> 04:08.810 Now what if what if my on time was zero and the total time was for you is going to be zero. 04:08.850 --> 04:11.720 That's exactly what happens when you say you recycle zero. 04:11.940 --> 04:13.970 But if you say on time. 04:13.980 --> 04:21.240 So if you say 50 percent that means that it's two by four that means on two times all two times but 04:21.280 --> 04:24.000 total time before that is you. 04:24.280 --> 04:26.940 So initially recycle is zero. 04:27.190 --> 04:32.440 Now if you want to change that you recycle during the course of the program you can do something like 04:32.440 --> 04:32.720 this. 04:32.720 --> 04:42.850 BW on underscored OPG dot change or duty cycle does change a duty cycle and you can give whatever cycle 04:42.850 --> 04:43.240 you want. 04:43.240 --> 04:46.710 Let's say for example if I give a hundred which means it'll be high. 04:48.420 --> 04:54.400 If I give ten or twenty five it's going to be 25 percent of the maximum will. 04:54.600 --> 04:56.850 The word that comes out from that particular pin. 04:57.060 --> 05:03.510 It's going to be 25 years old right now because I want to see a constant variation I want from low to 05:03.510 --> 05:07.660 high if I want to see it and I need to use a for loop I need to use a loop right. 05:07.680 --> 05:14.090 I'll save for the i in range for Range Range from what to from what value to what value. 05:14.190 --> 05:17.140 Let's see I want to start from duty cycle that is zero. 05:17.250 --> 05:21.240 I want to go up to a hundred and I want to go in steps off. 05:21.450 --> 05:27.150 Let's make it one let's make it five instead of five right. 05:27.200 --> 05:31.510 Readably underscored RBJ got change you recycle instead of saying 25. 05:31.500 --> 05:40.030 I'm going to say I because I is going to be zero five 10 15 so it's going to change up to 100 correct. 05:40.140 --> 05:40.970 Right. 05:40.990 --> 05:41.350 All right. 05:41.350 --> 05:47.470 So it's not going to be up to 100 because for is or you need to say hundred one right 100 plus one hundred 05:47.470 --> 05:50.250 and one that changed duty cycle. 05:50.350 --> 05:51.770 That's right. 05:52.240 --> 05:53.770 OK. 05:53.860 --> 05:58.120 But then you will be able to see it if you do not give a small Deely. 05:58.230 --> 05:59.710 So I'm going to give a small delay. 05:59.710 --> 06:07.840 I'm going to say time that sleep time is from time of important sleep so I can use sleep matter directly. 06:07.840 --> 06:11.230 I can say sleep for. 06:11.600 --> 06:13.990 Let me say it's in seconds right. 06:13.990 --> 06:18.420 So let me say 0.2 seconds or point. 06:18.460 --> 06:18.750 Yeah. 06:18.780 --> 06:19.710 Point three seconds. 06:19.700 --> 06:20.250 That's it. 06:20.260 --> 06:21.930 I don't want for more. 06:22.270 --> 06:24.360 I don't want to wait for a long time. 06:24.640 --> 06:25.250 OK. 06:25.330 --> 06:27.850 Now so that's about from low to high. 06:27.910 --> 06:30.910 And let me make one from high to low also. 06:31.090 --> 06:33.520 So let me say a four iron range 06:36.790 --> 06:46.830 101 say 100 to zero hour to go down in steps of minus 5. 06:47.240 --> 06:57.860 Scott I want to change GWM underscore Obuchi doctor change duty cycle. 07:01.290 --> 07:03.880 Changed by I again. 07:04.620 --> 07:07.790 And of course you have a small delay of point three. 07:08.100 --> 07:08.970 Right. 07:09.330 --> 07:09.900 OK. 07:09.900 --> 07:14.950 So I'm going to save this and I'm going to run the code now. 07:15.300 --> 07:18.660 So first of all let's check if there are any errors. 07:18.660 --> 07:21.790 No there are no errors thankfully. 07:21.990 --> 07:29.630 So what it can do now is show you how to how to connect the particular pin. 07:29.670 --> 07:32.940 And let's see the output on the Raspberry Pi. 07:33.420 --> 07:34.240 Correct. 07:34.260 --> 07:35.900 Q All right. 07:35.940 --> 07:42.210 Well let's have a look at the PWO for now for now I'll remove the cell in this button which I've already 07:42.210 --> 07:45.950 connected before I can just rule that out. 07:48.690 --> 07:55.770 I just need the Elodie as you can see and all of the LTE let me connect. 07:55.940 --> 08:02.730 Let me connect the yeah the C.A. of the reality and connected to the red wire. 08:03.030 --> 08:10.240 And the cats are connected why the résistance and connecting it to the port which is there at the bottom. 08:10.500 --> 08:15.870 And of course I need to connect this to ground so ground can be PIN number 6 which we use last time 08:16.320 --> 08:21.590 bought the number 6 so that's one two three four five six or six. 08:21.700 --> 08:31.610 But the one we're just to the beat of the rim is spin number 19 which as I said it was three Turbin 08:31.650 --> 08:34.710 from the bottom that was what we saw. 08:35.150 --> 08:40.520 If you remember in the diagram G.P.A. was a curve and then the bottom that the spin number Toli fights 08:41.640 --> 08:43.740 board numbering. 08:43.890 --> 08:45.760 I'm just going to take that up. 08:45.790 --> 08:46.540 All right. 08:46.600 --> 08:47.200 OK. 08:47.200 --> 08:54.740 And let me run my code and let me check what exactly is happening with this particular court. 08:54.820 --> 08:58.930 OK so I'll go back and I run my code and just check it out. 08:59.350 --> 09:00.450 OK so. 09:00.510 --> 09:02.050 Oh oops. 09:02.080 --> 09:03.130 Just a second 09:06.210 --> 09:09.550 and second one second. 09:09.550 --> 09:10.690 All right. 09:10.690 --> 09:20.330 So we're going to have this let's say I'm running that five OK. 09:20.410 --> 09:25.790 Can you see the intensity varying from low to high and then go down. 09:25.840 --> 09:32.040 OK so the second highest and then it's going from high to low low low low low low and then zero. 09:32.350 --> 09:33.550 And then again 09:35.740 --> 09:43.290 OK it's going to take some time to go up to zero because I've given a little bit more delay. 09:43.310 --> 09:45.140 Point Three is a little more for it. 09:45.310 --> 09:47.800 Maybe I should give it a point to do it. 09:48.550 --> 09:55.390 And then once it goes down completely down it will come up again from low to high. 09:55.620 --> 09:56.100 OK. 09:56.260 --> 09:59.460 So this is about a pulse rate moderation. 09:59.760 --> 10:00.460 OK. 10:00.880 --> 10:07.000 But of course we haven't done this constantly right in our code. 10:07.150 --> 10:12.240 What we've done is we have made it from high low to high and then made from high to low. 10:12.460 --> 10:14.180 And the program stops there. 10:14.280 --> 10:19.280 Do you want that to happen again and again then put the boot the for loop should we put inside. 10:19.630 --> 10:22.460 While true right so I'm going to put that in white too. 10:22.480 --> 10:23.700 I'm going to modify my code. 10:23.710 --> 10:28.600 I'm not going to show that to you now but I modified my code in such a way that it goes from low to 10:28.600 --> 10:29.470 high. 10:29.900 --> 10:30.680 OK. 10:30.700 --> 10:42.150 And then it goes from high to low and then from low to high again. 10:42.270 --> 10:43.830 And then from 10:46.710 --> 10:51.550 high to low I can you see them. 10:51.580 --> 10:52.970 And then again from low to high. 10:53.140 --> 10:54.760 So that's what happens. 10:54.760 --> 10:57.580 So I'm not really sure if we can see that in the video. 10:57.580 --> 10:57.950 Yes. 10:57.990 --> 11:01.360 So that's quite clearly visible high. 11:01.360 --> 11:03.700 And then from high goes down to low. 11:03.790 --> 11:06.060 And then that's you know what effect. 11:06.070 --> 11:06.760 Right. 11:06.760 --> 11:12.750 So this is about all of a P.W. in which we have right now.