WEBVTT

00:00.180 --> 00:07.040
Let's come back to our digital pings on the audio, as you can see, some of the pings have a bit of

00:07.040 --> 00:07.950
volume function.

00:07.980 --> 00:15.030
I'm going to explain what is B.W. in just a moment so you can recognize them with the Tildy.

00:15.030 --> 00:18.000
Need a number for the pin on Arduino.

00:18.060 --> 00:25.120
You know, out of the 14 digital pings, six of them can be used as output beams with a bit of value

00:25.120 --> 00:32.580
when they are pings, number three, five, six, nine, 10 and 11.

00:33.420 --> 00:40.810
Now, what is a bit of a win win means both with modulation.

00:41.400 --> 00:43.290
That's quite a complicated name.

00:43.290 --> 00:49.560
But you will see it's quite easy to understand when you use a digital pin with a binary state.

00:49.860 --> 00:57.240
Either the voltage is high, which means five all the time are low, which means zero volt all the time.

00:57.840 --> 01:06.030
With a pinger win, you can choose to make the signal high only a fraction of the time, and this fraction

01:06.030 --> 01:10.410
of the time in percentage is called the duty cycle.

01:10.680 --> 01:13.020
So here we have three examples.

01:13.290 --> 01:16.240
First, we have a duty cycle of zero percent.

01:16.680 --> 01:21.020
This means that the signal will be high zero percent of the time.

01:21.540 --> 01:23.950
Thus the signal is always low.

01:24.420 --> 01:29.970
In practice, this is the exact same as just using digital right with low.

01:30.720 --> 01:36.890
If we look at the third example on the bottom here, we have a duty cycle of 100 percent.

01:37.410 --> 01:41.990
That means that signal will be high 100 percent of the time.

01:42.570 --> 01:45.050
Thus the signal is always higher.

01:45.510 --> 01:50.320
In practice, this is the exact same as just using digital rights with height.

01:50.880 --> 01:56.700
And now the interesting part, if you look at the example in the middle, you can see we have a duty

01:56.700 --> 01:58.990
cycle of 25 percent.

01:59.490 --> 02:08.040
This means that the signal will be high 25 percent of the time and low 75 percent of the time.

02:08.610 --> 02:15.000
In practice, for example, when you go on and instead using the P the volume of a digital.

02:15.720 --> 02:22.740
Well, if you see 25 percent of the duty cycle, it's very similar as if instead of supplying five votes

02:22.740 --> 02:31.230
to the pin, you just supplied one point twenty five volt, which corresponds to 25 percent of the vote.

02:31.680 --> 02:37.710
Thus, you can expect the energy to be both on that with a lower intensity.

02:38.280 --> 02:45.210
To make it simple, just think about the duty cycle of the people, um, as a percentage of the total

02:45.360 --> 02:46.070
voltage.

02:46.470 --> 02:53.040
And you can see that if you modify the volume duty cycle between zero and one hundred percent, you

02:53.040 --> 02:58.110
can have much more control over the average voltages supply to your components.

02:58.500 --> 03:07.080
Now on the Arduino, the percentage will be represented by an integer number between zero and two hundred

03:07.080 --> 03:13.860
fifty five zero is, of course, zero percent and two hundred fifty five is one hundred percent.

03:14.100 --> 03:20.550
If you want to apply a 25 percent duty cycle for the PITIABLY, when you will then need to give twenty

03:20.550 --> 03:25.250
five percent of 255, which is about 64.

03:25.830 --> 03:27.820
So let's complete our diagram.

03:28.320 --> 03:33.630
We are still setting the mode for the digital Pinas output and then we have two options.

03:34.020 --> 03:40.140
Either we use the PIN with a binary state, which means we use the digital right function with a high

03:40.390 --> 03:41.810
or low ball.

03:41.820 --> 03:49.130
And this only applies to things with the PWI in March, we can set an analog value using the analog

03:49.140 --> 03:56.580
right function, which we are going to see in the next listen and provide a value between zero and 255,

03:56.880 --> 04:00.360
which corresponds to the percentage of the duty cycle.
