Hollway creator B.-W object of BW object is created by saying GPI all dot beat up.
I'm going to use the P.W. clause to create an object DWM class in the art quite cheaply IO library which
I'm commonly chauffeuring is GPI so cheaply I got the beat up Wium class I'm going to use the glass
and I'm going to pass these parameters to the in it method.
Right.
I'm going to pass these parameters to paramita that requires are the pin number for the bit of them
that you're using that has been number 19 and the frequency that you are going to maintain for the entire
P.W. object.
So let's say I want to maintain a frequency of let me say Hausen thousand words.
All right.
That's the frequency that I want to maintain.
OK so it's mid frequency range not a very high frequency nor a very low frequency.
OK so it's a frequency.
All right so I'm going to create an object so if I have to create an object which means I need to say
I need to store it in a variable or stored in an object that can speed up the underscore.
So I created it using the BWF class.
I passed these and I passed these parameters which went to the in a method of the P.W. class and to
return an object that created an object for you which of which can be you know you can use this object
to.
You can use now these object to access the methods of the freed up the class in order to do whatever
you want to do.
So let's say for example.
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.
In my program which means I need to see all right PIN number 19 you are up and you are GPI open form.
You are the GPI open or you are the chosen one for my program.
Now I want you there now when you start up what should be the voltage set you are going to give at the
start that I need to say is I need to say DWM DWM underscore RBJ and you say Doc start to use this method
have uses method start which is which is there in the PWO class.
I need to use this method start and say OK boss.
Please start at the voltage of let's say zero or this is more.
This is not a voltage actually.
This is called as duty cycle.
So what did you decide whose duty cycle duty cycle is equal to on time divided by total time on time
divided by total time.
So what is on time and what is total time.
OK so let's say for example I told you if if your switch you switch it on for you know switch it on
for a long time then you switch it off.
That means the water will be a very it will be closer to the maximum then close to the minimum.
But if your off time is more then you could be closer to the minimum than to the max.
Right.
So we have a part of the cycle where you recycle is on time.
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
1 divided by the total time is four.
So that means time is going to be how much.
If this is one and total time is four then off is going to be for the ride.
So that means one by four.
What would be the voltage or would it be that you recycle recycle well with the word this which comes
out it is going to be just it is just going to be 25 percent which right now is going to be 25 percent.
Right.
Now what if what if my on time was zero and the total time was for you is going to be zero.
That's exactly what happens when you say you recycle zero.
But if you say on time.
So if you say 50 percent that means that it's two by four that means on two times all two times but
total time before that is you.
So initially recycle is zero.
Now if you want to change that you recycle during the course of the program you can do something like
this.
BW on underscored OPG dot change or duty cycle does change a duty cycle and you can give whatever cycle
you want.
Let's say for example if I give a hundred which means it'll be high.
If I give ten or twenty five it's going to be 25 percent of the maximum will.
The word that comes out from that particular pin.
It's going to be 25 years old right now because I want to see a constant variation I want from low to
high if I want to see it and I need to use a for loop I need to use a loop right.
I'll save for the i in range for Range Range from what to from what value to what value.
Let's see I want to start from duty cycle that is zero.
I want to go up to a hundred and I want to go in steps off.
Let's make it one let's make it five instead of five right.
Readably underscored RBJ got change you recycle instead of saying 25.
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.
Right.
All right.
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
and one that changed duty cycle.
That's right.
OK.
But then you will be able to see it if you do not give a small Deely.
So I'm going to give a small delay.
I'm going to say time that sleep time is from time of important sleep so I can use sleep matter directly.
I can say sleep for.
Let me say it's in seconds right.
So let me say 0.2 seconds or point.
Yeah.
Point three seconds.
That's it.
I don't want for more.
I don't want to wait for a long time.
OK.
Now so that's about from low to high.
And let me make one from high to low also.
So let me say a four iron range
101 say 100 to zero hour to go down in steps of minus 5.
Scott I want to change GWM underscore Obuchi doctor change duty cycle.
Changed by I again.
And of course you have a small delay of point three.
Right.
OK.
So I'm going to save this and I'm going to run the code now.
So first of all let's check if there are any errors.
No there are no errors thankfully.
So what it can do now is show you how to how to connect the particular pin.
And let's see the output on the Raspberry Pi.
Correct.
Q All right.
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
connected before I can just rule that out.
I just need the Elodie as you can see and all of the LTE let me connect.
Let me connect the yeah the C.A. of the reality and connected to the red wire.
And the cats are connected why the résistance and connecting it to the port which is there at the bottom.
And of course I need to connect this to ground so ground can be PIN number 6 which we use last time
bought the number 6 so that's one two three four five six or six.
But the one we're just to the beat of the rim is spin number 19 which as I said it was three Turbin
from the bottom that was what we saw.
If you remember in the diagram G.P.A. was a curve and then the bottom that the spin number Toli fights
board numbering.
I'm just going to take that up.
All right.
OK.
And let me run my code and let me check what exactly is happening with this particular court.
OK so I'll go back and I run my code and just check it out.
OK so.
Oh oops.
Just a second
and second one second.
All right.
So we're going to have this let's say I'm running that five OK.
Can you see the intensity varying from low to high and then go down.
OK so the second highest and then it's going from high to low low low low low low and then zero.
And then again
OK it's going to take some time to go up to zero because I've given a little bit more delay.
Point Three is a little more for it.
Maybe I should give it a point to do it.
And then once it goes down completely down it will come up again from low to high.
OK.
So this is about a pulse rate moderation.
OK.
But of course we haven't done this constantly right in our code.
What we've done is we have made it from high low to high and then made from high to low.
And the program stops there.
Do you want that to happen again and again then put the boot the for loop should we put inside.
While true right so I'm going to put that in white too.
I'm going to modify my code.
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
high.
OK.
And then it goes from high to low and then from low to high again.
And then from
high to low I can you see them.
And then again from low to high.
So that's what happens.
So I'm not really sure if we can see that in the video.
Yes.
So that's quite clearly visible high.
And then from high goes down to low.
And then that's you know what effect.
Right.
So this is about all of a P.W. in which we have right now.