It's time for a new activity in this activity.
We practice we've the with the P.W. function and also with the programming concepts you have seen before,
the open a new project here and your challenge will be to make the LSD fade in and fade out, just as
you can see on the video right now.
So how to do this?
I'm going to give you a few hints, OK, and then the solution in the next video, you will need to
initialize the inequity before we speed mode, etc., and then to make the LCD fade and fade out, you
will actually write code in the loop, OK?
And you will need to use to for looks.
OK, so I'll look here.
To go from zero to 200.
55 and another for.
To go from 255 to zero, the why is that, because the great function can take a value between zero
and two hundred fifty five.
OK, zero means boiled off and 255 means up with the maximum intensity.
So you need to go from zero all the way up to 255.
And then once you reach this number, you need to go back to zero.
OK, step by step, number by number and every time you will.
But this number into the the right function.
So you will have another right with zero and then with one, with two with three, etc..
But as you can guess, you are not going to write the great function 500 times, OK.
Instead you are going to use four loops.
So you have already seen how to use a fluke to go from number to another number by incrementing the
index every time we have I.
Lesperance so that that you know, but actually it's not the only way to write for the can.
Right.
To follow up to actually decrease the index.
OK, I'm just going to give you the structure for that so you have your full loop.
And then you start the index instead of starting at zero, you will start at two hundred and fifty five
a semicolon.
And then the condition so that the loop can continue is simply that the index is greater or equal.
Then zero.
And finally, what we're going to do with the index is not a plus plus, but I minus minus eight plus
plus means you add one to a A minus, minus means you decrease.
I buy one.
So we start 255 and then 250 points at zero all the way down to zero and then stop.
All right.
So we've not you should have enough information to injectivity and also what you're going to need.
The last thing is to add a small delay, OK, between each analagous.
Right that you do, because if you do it at full speed, it will be way too quick for you to see anything.
So you can add a delay of five milliseconds, OK, between each iteration of the folk, you can add
a five minute delay.
This is the value that I used in the video that I showed you about the result.
Now, of course, you can tinker this value.
If you want to increase or decrease it, it's up to you.
And now, well, it's you turn practice and I will see you in the next video for the solution.