Official Arduino - Fade Tutorial". This is another way to make an LED fade in and out. By this point you should be able to understand virtually everything in the code below. There is only one piece we've not covered yet:
This if statement looks a bit different. The double vertical line "||" means OR. This if statement is true if brightness is 0 OR 255. Pretty cool. You can also do an AND so that both statements have to be true. For AND you use &&.
You should be able to determine exactly how the remaining bits of the code work. You should be prepared to explain this as it might show up on an assessment.