WEBVTT

00:00.210 --> 00:03.420
It's time for a new activity in this activity.

00:03.510 --> 00:11.540
We practice we've the with the P.W. function and also with the programming concepts you have seen before,

00:12.000 --> 00:21.780
the open a new project here and your challenge will be to make the LSD fade in and fade out, just as

00:21.780 --> 00:23.460
you can see on the video right now.

00:25.860 --> 00:27.100
So how to do this?

00:27.120 --> 00:33.750
I'm going to give you a few hints, OK, and then the solution in the next video, you will need to

00:33.750 --> 00:41.310
initialize the inequity before we speed mode, etc., and then to make the LCD fade and fade out, you

00:41.310 --> 00:44.510
will actually write code in the loop, OK?

00:44.820 --> 00:48.910
And you will need to use to for looks.

00:49.290 --> 00:51.420
OK, so I'll look here.

00:52.650 --> 00:55.470
To go from zero to 200.

00:57.830 --> 00:59.930
55 and another for.

01:01.560 --> 01:10.170
To go from 255 to zero, the why is that, because the great function can take a value between zero

01:10.170 --> 01:11.920
and two hundred fifty five.

01:12.130 --> 01:19.810
OK, zero means boiled off and 255 means up with the maximum intensity.

01:20.130 --> 01:24.630
So you need to go from zero all the way up to 255.

01:24.840 --> 01:29.070
And then once you reach this number, you need to go back to zero.

01:29.400 --> 01:33.740
OK, step by step, number by number and every time you will.

01:34.020 --> 01:37.100
But this number into the the right function.

01:37.130 --> 01:42.390
So you will have another right with zero and then with one, with two with three, etc..

01:42.930 --> 01:49.000
But as you can guess, you are not going to write the great function 500 times, OK.

01:49.440 --> 01:51.630
Instead you are going to use four loops.

01:51.990 --> 01:59.100
So you have already seen how to use a fluke to go from number to another number by incrementing the

01:59.100 --> 02:00.950
index every time we have I.

02:01.410 --> 02:06.950
Lesperance so that that you know, but actually it's not the only way to write for the can.

02:06.990 --> 02:07.140
Right.

02:07.140 --> 02:10.470
To follow up to actually decrease the index.

02:10.780 --> 02:16.050
OK, I'm just going to give you the structure for that so you have your full loop.

02:16.840 --> 02:23.980
And then you start the index instead of starting at zero, you will start at two hundred and fifty five

02:24.520 --> 02:26.290
a semicolon.

02:26.650 --> 02:34.810
And then the condition so that the loop can continue is simply that the index is greater or equal.

02:36.590 --> 02:37.770
Then zero.

02:38.630 --> 02:47.540
And finally, what we're going to do with the index is not a plus plus, but I minus minus eight plus

02:47.540 --> 02:52.930
plus means you add one to a A minus, minus means you decrease.

02:53.240 --> 02:54.330
I buy one.

02:54.650 --> 03:00.740
So we start 255 and then 250 points at zero all the way down to zero and then stop.

03:01.160 --> 03:01.490
All right.

03:01.500 --> 03:07.540
So we've not you should have enough information to injectivity and also what you're going to need.

03:07.550 --> 03:12.020
The last thing is to add a small delay, OK, between each analagous.

03:12.020 --> 03:17.750
Right that you do, because if you do it at full speed, it will be way too quick for you to see anything.

03:18.380 --> 03:28.460
So you can add a delay of five milliseconds, OK, between each iteration of the folk, you can add

03:28.460 --> 03:30.020
a five minute delay.

03:30.320 --> 03:34.810
This is the value that I used in the video that I showed you about the result.

03:35.180 --> 03:37.100
Now, of course, you can tinker this value.

03:37.100 --> 03:41.440
If you want to increase or decrease it, it's up to you.

03:41.720 --> 03:47.330
And now, well, it's you turn practice and I will see you in the next video for the solution.
