References: 2nd example of "FOR" faulty

The 2nd example, fading a LED up and down, is not correct.
It must be "if (i==255) x = -1" and not "if (i=255) x = -1".

edited!

You :-[ I might want to check the difference between = and ==.

http://arduino.cc/en/Reference/If

regards
Jeroen